46Views2Replies

Author Options:

D-Pad data compression? Answered

So, I'm working on a small, simple, and yet very inefficient game console using multiple ATmega328 chips. Basically, I'm trying to compress the controller data into as few wires as possible using an ATmega. Hopefully using something along the lines of http://pinouts.ru/Game/genesiscontroller_pinout.shtml. Anyone have any idea how to do this? I can handle coding, it's just the actual logic of it. 

Discussions

0
None
Downunder35m

4 years ago

Map them as a byte and you can "control" 256 buttons.

For example the 4 directions:

Instead of using a single input for each button you "address" the buttons.

So each button get's a number.

Up=1
Down=2

Left=3
Right=4

This information can be transmitted in digital form depending on what type of input you use on the chip.

To add more button, fire, stop and so on you can use higher numbers and add them.

Same for the directions if diagonal is necessary too, just just different numbers.

With the above to add buttons:

Fire1=5

Fire2=10

Just fire1 is 5, with Right motion it adds to 9, with Up motion to 6....

You get the picture?

0
None
Krayzi99Downunder35m

Reply 4 years ago

Ah, I see what you're saying. I have the serial port tied up already, perhaps something like "if joystickUp then HIGH, if not joystick Up then LOW", and keep running that in sequence until the amount of buttons has been passed to the main chip. Looking now at the Nintendo 64 controller protocol, what you're describing seems to be very similar.