• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RS-232 SPI CONTROLLER – part 2

    Blog entry posted in 'Electronics and Other Ramblings...', January 31, 2012.

    This second part is more of a let’s play with this a little, than actually something truly new. How can we put the SPI controller to use. This may not be the best application, but we’ll this circuit to control the same NS73M FM module described previously (http://www.electro-tech-online.com/blogs/languer/186-ns73m-controller-fm-transmitter.html). The use is quite simple: connect to the SPI Controller, send RS232 commands to perform the same initialization and control of the NS73M module as was done with the PIC on the other post. So what is really accomplished with this? Nothing really. But if you want to perform a quick evaluation of SPI modules, this does provide the opportunity. I also used the opportunity to create a RealStudio (http://www.realsoftware.com/realstudio/) application just because I wanted to do a nifty interface; but this could have been easily done with a simple RS232 terminal.

    A few caveats:
    • The NS73M module requires a 4-bit address and an 8-bit command. To properly send this over the SPI Controller, the 4-bit address must be padded with zeroes.
    • The SPI communications to the NS73M module is send lsb first, but broken down by address and data. So the address is sent lsb-first, and then the data is sent lsb-first.
    70256
    • All this means is that the RS232 interface has to properly handle this. For example, on our RealStudio application the address bits were reversed and the resultant nibble (4-bits) padded with 4 zeroes. Then the data bits were reversed and appended to the end of the modified address byte.
    70257

    One more thing: I’ve been trying for a while to test my new Saleae LOGIC device, and this presented a cool way of trying it. Below is a snapshot of the first command. To read it properly one has to remember that the address byte is really a nibble. For example, 0x05E0 on the analyzer is really 0xE for the address nibble and 0x05 for the data byte.
    70255

    Can’t say enough cool things about this nifty tool. The table below comes from a text file the LOGIC tool spits out with the decoded serial data:
    70254

    Well that’s it for now, next we’ll try to add the read capability (i.e. bidirectional).

    Comments
 

EE World Online Articles

Loading

 
Top