Feed on
Posts
Comments

GBxCart RW v1.0 Released

GBxCart RW v1.0 has now been released and is available for purchase (I decided to rename it from GBxCartRead as we also do writing too). The PCBs arrived and everything worked however I got the switch connections reversed, so changing it to the left means 5V is selected and to the right means 3.3V is selected, so just be extra careful when using a GBA cartridge.

// Set pin output as low
else if (receivedChar == SET_OUTPUT_LOW) {
	char portChar = USART_Receive();			
	usart_read_chars();
	uint8_t setValue = strtol(receivedBuffer, NULL, 16);
	
	PORTD |= (1<<LED);
	if (portChar == 'A') {
		PORTA &= ~(setValue);
	}

I’ve decided to add raw I/O access to the Gameboy Slot pins through the COM port as some users may not be able to update the ATmega with new versions, so if there were any carts I would like to add support for, we could control the all pins from the software, it’ll be slower but it will work.

There was also a strange bug with an SRAM game I had, if you plugged it in and powered up GBxCart RW, saved the save game, one byte would randomly read as 0x00. Writing the correct save and re-reading resulted in no problems, so it sounded like a start up problem.

// Reset common lines high
rd_wr_csmreq_cs2_reset();

// Set outputs
DDRD |= (1<<LED) | (1<<WR_PIN) | (1<<RD_PIN) | (1<<CS_MREQ_PIN) | (1<<CS2_PIN);

I ended up having to set the PORTs of the common lines like RD, WR high (which would pull them up) before setting the DDRs as outputs and that would then set them high. Before I was setting them as outputs (low) and then setting them high, that was something I hadn’t considered, the power up state of the ATmega.

Leave a Reply