gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Hardware > I/O or A/D Port

#106979 - dios - Wed Oct 25, 2006 12:29 pm

Hi all,

I have been playing around with the ELV data logger card for a while now, but it does not satisfy my needs very much. What I am looking for is a cheap - ok, the ELV card is very cheap - way to add one or better two I/O ports to my GBA. Together with a A/D converter, I'd like to use it for diaplaying data like temperatures and pressures.
I've read a bunch of websites, but I have not really found what I am looking for. I am not so much interested in developing my own card, even if I could, but I hoped to find something finished. Does anyone here have a hint or two?

/dios

#107289 - phonymike - Sat Oct 28, 2006 8:02 am

I've used the com port (2 player cable) in general purpose mode to control an led sign with 382 leds using external led control chips at well over 60fps. but here'd be a simple and cheap way to give the gba 8 output lines, 2 of which would read 8 A/D lines.

the com port has 4 lines you can control directly from the gba. from what I've read, only 3 should be used for output, the last one should be used for input only. so if you want only 2 outputs, using the com port makes writing a high or low as easy as writing a bit in the io register.

74HC595 serial to parallel converter. using 2 or 3 of the port lines, tell the 595 the values you want the 8 outputs to be.

like clock, data, clock, data, clock, nothing, clock

would result in two pins being high, one pin being low. you'd do this for all 8 pins. very easy.

ADC0832CCN 8-bit A/D Converter with MUX (2ch) this little chip would send back a 12 bit digital value of the analog voltage. this to needs just clock and data. you'd clock out some bits telling it which input you want (1 of the 2) then you would clock in the 12 bits to the gba and there's your a/d. but you'd do this from the 595. don't worry about speed, you'll have no trouble updating this stuff at speeds well over 60 times a second with little code.