HOME ARTICLES DOWNLOADS CONTACT


Openschemes Feed
Main Menu
Openschemes Articles
Categories
Site Sponsors
Site Hits
Total Hits


Bit Banging SPI on Arduino’s FT232RL

QRCode


Tags: , , , , ,

Filed under: FT232 | November 5, 2009 @ 12:40 am (Views: 2907)


The next section of the tool deals with the actual data to be transmitted/received.  Your options are Data Length and MSB First/LSB First.  Data Length should be pretty self explanatory - do you want to send 4 bits, 8, 16, 24?  Please note that long transmissions will get fragmented by the USB subsystem.  It should still work fine (the SPI chip doesn’t care!) but the scope shot will be ugly with pauses stuck in there randomly.  It will not interfere with the transmission because the pins will stay in their present state during the pause.

Obviously, your data out length should match with the transmission length - 4 bit expects one hex char, 8-bit expects two, and so on.  Running a 24 bit send with only one byte in the Data Out box will send two bytes worth of 0, then your expected byte.  Sometimes that sort of action is needed, so that’s why it was implemented this way.  Here’s a shot of a standard 16-bit transaction sending $AA55 (1010 1010 0101 0101)


Bit Banged 16 bit SPI sending $AA55

Fig 6 - 16-bit SPI Transaction Sending $AA55


The last config item is data order: Sending MSB first or MSB last.  This works pretty much as you expect it to - you can see the effect in the scope shots below, where the byte $80 (1000 0000) is sent using standard polarity with both normal and reverse data order.  In one case, the logic high appears on the first clock, and in the second case the logic high appears on the last clock.  Got it? Killer.


SPI send of $80 with normal bit order  SPI Send of $80 with reverse bit order

Fig 7 & 8 - SPI Send of $80 (1000 0000) with normal and reverse bit order


Continued on Next Page…

Bookmark and Share

Pages: 1 2 3 4


Related Posts:
  • Nandoori - SPMP8k Raw USB NAND Dumper (February 16, 2010)
  • SPMP8k FRMorp v1.1 - Improved the Linux side (February 9, 2010)
  • SPMP8k FRMorp - USB IMG dumper (February 8, 2010)
  • Hacking no-name "MP5" players with SPMP8000A - Part I, teardown (January 3, 2010)
  • Simple Simon's SparkFun Mod (December 18, 2009)

  • Metadata:

    Leave a comment





    Contact Openschemes


    Copyright © 2003 by Openschemes  |   |  Design by 7dana.com