sdlocker-tiny icon indicating copy to clipboard operation
sdlocker-tiny copied to clipboard

Using USI

Open tz1 opened this issue 11 years ago • 2 comments

I forked the repo (to my tz1) and added USI support. The docs are at best confusing, at worst wrong, but I get the high speed.

NOTE MOSI and MISO are REVERSED!!! - I needed to swap the pins.

I'm also not using the interrupts, but doing a series of writes to the register to do the clocking - 1 cycle each. There are other optimizations, but this is the main one.

I've done I2C master using the USI, and always wanted to try to get the SPI working.

Thanks for the port.

tz1 avatar Jan 21 '14 06:01 tz1

Nice! I did try swapping MISO and MOSI, but couldn't get it to work either way. Thanks for the tip, I'll try again.

Nephiel avatar Jan 22 '14 11:01 Nephiel

The fork in my repo has a cleaned up version using the USI, or if you need help, just ask.

I needed to use a scope - the datasheet ans sample code is unclear, probably wrong. I just tweaked it until my waveforms were like yours, only faster. On Jan 22, 2014 3:19 AM, "Nephiel" [email protected] wrote:

Nice! I did try swapping MISO and MOSI, but couldn't get it to work either way. Thanks for the tip, I'll try again.

— Reply to this email directly or view it on GitHubhttps://github.com/Nephiel/sdlocker-tiny/issues/1#issuecomment-33013022 .

tz1 avatar Jan 22 '14 13:01 tz1