Monday, 27 July 2015

attiny - Does anyone have code to emulate a 16-bit input shift register with an ATtiny2313?


I would like to use an ATtiny2313 to emulate a Super Nintendo controller because I have an ATtiny2313 but I do not have an input shift register and I don't feel like soldering wires onto an existing SNES controller board.


This application requires 12 inputs (bits 13-16 are always 1) and a latch, clock, and data out pin.


Do you have this code lying around? It can't be more than 20 instructions.



Answer



There's already an 8-bit shift register built into the Universal Serial Interface (USI). All you have to do is use it twice in a row.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...