Jump to content

MIDIbox TIA - Atari 2600 Synth


Recommended Posts

Hi Bruno,

I flashed the new HEX, I think everything works better... except the led meter :)

I get the start up behaviour, but when I'm playing, I just get MIDI IN (upper led) reaction.

No other led-animation from the eight other leds.

Nicolas

Link to comment
Share on other sites

Hello,

I found the issue but I'm not able to explain it.

There's a flag to refresh the LED_METER in tia_sr.inc:
This flag is set on each TIA registers value change:

bsf     TIA_LEDMTR_STAT, TIA_LEDMTR_AUDX_REQ

in TIA_SR_Handler

;; --------------------------------------------------------------------------
;;  Check for changes in TIA registers, transfer values to TIA
;;  and handle Wavetable
;; --------------------------------------------------------------------------
TIA_SR_Handler
	btfsc	TIA_STAT, TIA_STAT_ENGINE_DISABLE
	return

	;call	TIA_WT_Handler			; call wavetable handler before continue
_TIA_SR_Handler
TIA_SR_Start

	TABLE_ADDR TIA_SR_REGWRITE_TABLE	; contains order of register accesses
	movlw	6		; number of registers (0x06)
	movwf	TMP1				; TMP1 is the loop counter
	lfsr	FSR0, TIA_BASE			; store base address of TIA registers in FSR0
	lfsr	FSR1, TIA_SHADOW_BASE		; store base address of shadow registers in FSR1

	IRQ_DISABLE				; disable interrupts

TIA_SR_Loop
	tblrd*+
	movf	TABLAT, W
	movff	PLUSW0, MIOS_PARAMETER2		; store value of TIA in MIOS_PARAMETER1 and increment FSR0
	BRA_IFSET TIA_STAT, TIA_STAT_FORCE_REFRESH, ACCESS, TIA_SR_Transfer; don't skip if refresh has been forced
	movf	PLUSW1, W			; get content of appr. shadow register
	cpfseq	MIOS_PARAMETER2, ACCESS; transfer to TIA if not equal
	rgoto TIA_SR_Transfer	
  	rgoto	TIA_SR_Next			; skip following code if equal

TIA_SR_Transfer
	;; register change: write value into shadow register and transfer it to TIA
	movf	TABLAT, W
	movff	MIOS_PARAMETER2, PLUSW1		; store value in shadow register

	movf	TABLAT, W			; extract address, add offset
    addlw   0x05
	movwf	MIOS_PARAMETER1			; store in address register

	rcall	TIA_SR_Write			; transfer to TIA
    bsf     TIA_LEDMTR_STAT, TIA_LEDMTR_AUDX_REQ
    
TIA_SR_Next
	decfsz	TMP1, F				; decrement loop counter until it is zero
	rgoto	TIA_SR_Loop

	IRQ_ENABLE				; enable interrupts again

	bcf	TIA_STAT, TIA_STAT_FORCE_REFRESH; clear refresh request (if it has been set before)

	return

When the LED_METER Handler is called
It first checks the flag and decides what to do

;; --------------------------------------------------------------------------
;;  LEDMTR module Handler
;; --------------------------------------------------------------------------
TIA_LEDMTR_Handler
	SET_BSR	TIA_BASE		; prepare BSR for TIA register access
    BRA_IFCLR TIA_LEDMTR_STAT, TIA_LEDMTR_AUDX_REQ, ACCESS, TIA_LEDMTR_Handler_End
    
TIA_LEDMTR_Handler_Meter_Norm     
    bcf     TIA_LEDMTR_STAT, TIA_LEDMTR_AUDX_REQ

    clrf    TIA_LEDMTR_VALUE
    movlw   0x01
    cpfslt  TIA_AUDV0
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR0
    movlw   0x07
    cpfslt  TIA_AUDV0
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR1
    movlw   0x0b
    cpfslt  TIA_AUDV0
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR2
    movlw   0x0e
    cpfslt  TIA_AUDV0
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR3
    
    movlw   0x01
    cpfslt  TIA_AUDV1
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR4
    movlw   0x07
    cpfslt  TIA_AUDV1
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR5
    movlw   0x0b
    cpfslt  TIA_AUDV1
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR6
    movlw   0x0e
    cpfslt  TIA_AUDV1
    bsf     TIA_LEDMTR_VALUE, TIA_LEDMTR7 

    movf    TIA_LEDMTR_VALUE, W
    movwf   MIOS_PARAMETER1
    rgoto   TIA_LEDMTR_Handler_Set

TIA_LEDMTR_Handler_Set
    movlw   TIA_LEDMTR_REG
    rcall    TIA_LEDMTR_Write

TIA_LEDMTR_Handler_End
	return

It seems to be something like a RAM issue. cause when I change the TIA_LEDMTR_STAT register address in app_defines.h it solves the problem.
This is what I changed:

;; ==========================================================================
;; free: 0x027-0x066

;; ==========================================================================

MIDI_RXTX_RX_CTR	EQU	0x067
MIDI_RXTX_TX_CTR	EQU	0x068
MIDI_RXTX_BEAT_CTR	EQU	0x069

;; ==========================================================================

TIA_LEDMTR_STAT     EQU	0x06a
TIA_LEDMTR_VALUE	EQU	0x06b

to

;; ==========================================================================
;; free: 0x027-0x04f

;; ==========================================================================
TIA_LEDMTR_STAT     EQU	0x050
TIA_LEDMTR_VALUE	EQU	0x051

;; ==========================================================================
;; free: 0x052-0x066

;; ==========================================================================
MIDI_RXTX_RX_CTR	EQU	0x067
MIDI_RXTX_TX_CTR	EQU	0x068
MIDI_RXTX_BEAT_CTR	EQU	0x069

;; ==========================================================================
;; free: 0x06a-0x06b

I've checked for address conflict, there's no :(

If anyone can explain me it, he is welcome !!!

Best regards
Bruno

PS: I will share a new firmware version asap...

Link to comment
Share on other sites

13 minutes ago, wired said:

Hey Bruno, would you have some spare fasteners to fasten my SUB-D25 to the aluminium backplane? Thanks!

Yes I saw that it's already done!
There was no sound because jumper for audio was not in the right position.
I remove the drilling helper from inside your box, this part is just to help you for drilling Leds holes and must be removed after hihi :)
Your box shines now ;)


Fichier%2012-07-2018%2010%2049%2029.jpg?

Best regards
Bruno

Link to comment
Share on other sites

  • 2 years later...
  • 4 months later...

I've made it to the "power it up and see" phase of building the cartridge TIA box.

When I do apply power, the LEDs for MIDI In and Out blink briefly, which feels like a booting-up indicator, and then the MIDI In light turns on and stays on.  That seems like a bad symptom so I pull power immediately.  I've tried reflowing some of the solder joints around the optocoupler's cluster of components and the DIN pins for MI+ MI-, also looking for solder bridges etc, but no luck so far.

FWIW, MIDI Out is working as expected -- when I power it up connected to MIOS Studio, it sends the "f0 00 00 7e 40 00 01 f7" as expected.  It's just the MIDI input on the cartridge that seems bad.

Any hints on where to look next for this?  I'm bumping up against my late-beginner limits.  Thanks in advance.

Edited by emerson
Link to comment
Share on other sites

18 hours ago, Antichambre said:

Hi do you use the provided DB25 adapter cable? Check it also please.

Am I right in seeing that the center pin of the MIDI Out DIN should be attached to pin 15 / ground of the DB25?  That one is not, I'll look to fix it.  The other four from the two MIDI DINs are correctly connected (ie, MIDI In seems to be hooked up correctly, unless it relies on the pin 15 / ground from the MIDI Out DIN).

(Edit: Or is this the thing I vaguely remember where you ground the MIDI cable shield but don't attach it to one of the pins?)

18 hours ago, Antichambre said:

Did you try to upload the application again?

MIDI In isn't working, and I don't have a PIC burner for surface-mount PICs, so... not yet.

 

Am I correct in thinking that the MIDI light staying on is possibly destructive and I shouldn't keep it powered up that way?

 

Thanks!

Edited by emerson
Link to comment
Share on other sites

10 hours ago, emerson said:

Am I right in seeing that the center pin of the MIDI Out DIN should be attached to pin 15 / ground of the DB25?  That one is not, I'll look to fix it.  The other four from the two MIDI DINs are correctly connected (ie, MIDI In seems to be hooked up correctly, unless it relies on the pin 15 / ground from the MIDI Out DIN).

(Edit: Or is this the thing I vaguely remember where you ground the MIDI cable shield but don't attach it to one of the pins?)

Good pinout is this one:
image.thumb.png.b4740ad55a9cc651c176b6822540b67f.png
Check if IN pins are not inverted
MIDI IN pin4 connected to MI+.  DB25 pin14, wire should be green
MIDI IN pin5 connected to MI-. DB25 pin1, wire should be white

MIDI OUT pin2(center) connected to ground. DB25 pin15
MIDI OUT pin4 connected to MO+. DB25 pin2, wire should be green
MIDI OUT pin5 connected to MI-. DB25 pin3, wire should be white

 

10 hours ago, emerson said:

MIDI In isn't working, and I don't have a PIC burner for surface-mount PICs, so... not yet.

There's no specific burner for surface mount, if you've got one you can connect it like this:


image.png.993d6197031b1bbfc46b14be2143cc78.png

10 hours ago, emerson said:

Am I correct in thinking that the MIDI light staying on is possibly destructive and I shouldn't keep it powered up that way?

No it's not destructive, le led are software driven, they their own pic pins.

Do you try to do a "Query" in MIOS Studio even with this led behavor? (with MIDI In and Oout connected).


 

 

Edited by Antichambre
Link to comment
Share on other sites

1 hour ago, Antichambre said:

Check if IN pins are not inverted
MIDI IN pin4 connected to MI+.  DB25 pin14, wire should be green
MIDI IN pin5 connected to MI-. DB25 pin1, wire should be white

MIDI OUT pin2(center) connected to ground. DB25 pin15
MIDI OUT pin4 connected to MO+. DB25 pin2, wire should be green
MIDI OUT pin5 connected to MI-. DB25 pin3, wire should be white

The green and white ones are correct, both pairs, and my meter tells me that the DIN pins and the DB25 pins for those are connected as you say.  Weirdly, DIN pin2 isn't grounded, even though the third wire from the MIDI Out cable goes to that pin.  I guess it didn't connect well when they made it, and I'm gonna have to take the connector apart more to debug that.

1 hour ago, Antichambre said:

There's no specific burner for surface mount, if you've got one you can connect it like this:

Hmm I used my PICkit clone to reprogram the bootloader into the PIC, and MPLAB reported success.  Now, though, when I put power to it while connected to MIOS Studio, it doesn't even give off the initial "f0 00 00 7e 40 00 01 f7" that it did previously.  I re-tried flashing the bootloader with MPLAB, and again it reported success, so the PIC is alive, at least, just not... doing anything.

1 hour ago, Antichambre said:

Do you try to do a "Query" in MIOS Studio even with this led behavor? (with MIDI In and Oout connected).

That doesn't work, and didn't work previously before I started tinkering with MPLAB -- it just gave the normal "No response from MIOS8 or MIOS32 core!" etc etc error.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...