gordon 229 Posted July 17, 2011 Share Posted July 17, 2011 I am trying to re-create this using USCI instead of USI. As seen there, USI can do 16-bit SPI transfers, which is needed to drive the MAX6957. Here is a small hint that USCI too is capable of 16-bit transfers, however I can't find anything related in the x2xx family guide nor the 2553 (which I'm trying to bend to my will) datasheet. Can USCI (SPI) do 16(or more maybe)-bit transfers? Quote Link to post Share on other sites
oPossum 1,083 Posted July 17, 2011 Share Posted July 17, 2011 Yes, any multiple of 7 or 8 bits. For many SPI peripherals, the SS or CS line is used to reset the internal SPI shift register. So to send a packet to the chip, assert SS, send one or more 7 or 8 bit chunks, and then deassert SS. Note that the STEN line is always an input and is used for optional muti-master arbitration in master mode. It is not used to control SS/CS of slaves on the bus. 4 wire master mode is not the same as a 4 wire SPI connection. cde 1 Quote Link to post Share on other sites
gordon 229 Posted July 17, 2011 Author Share Posted July 17, 2011 For many SPI peripherals, the SS or CS line is used to reset the internal SPI shift register. So to send a packet to the chip, assert SS, send one or more 7 or 8 bit chunks, and then deassert SS. You mean manually, right? Quote Link to post Share on other sites
oPossum 1,083 Posted July 17, 2011 Share Posted July 17, 2011 The firmware must control the SS line(s). The hardware has no idea how long a packet is. gordon 1 Quote Link to post Share on other sites
cde 334 Posted July 17, 2011 Share Posted July 17, 2011 The USI has 1 16bit register that can be addressed as 2 8bit registers for i2c transfers. The USCI does not. The shift registers hold bytes in the USCI so there is no option for 16-bit transfers. Instead,the UC7BIT can be set for 7-bit transfers, although I never encountered anything that usesthis (it is more applicable to UART mode). This is from the MSP430 Microcontroller Basics book. http://www.scribd.com/doc/55633665/85/SPI-with-the-USCI Quote Link to post Share on other sites
RobG 1,892 Posted July 17, 2011 Share Posted July 17, 2011 As cde already wrote, any chip with USI (2231 for example) can do 16 bit SPI w/o any problem. Search this forum for USI16B, there are many examples. Quote Link to post Share on other sites
gordon 229 Posted July 18, 2011 Author Share Posted July 18, 2011 My problem was actually with the concept of how to drive SS. Many have tried to explain that if the MSP is the master, SS will need to be driven manually and not left to USCI (USI), but for some reason it didn't really sink in until oPossum chimed in . My thickness can be astronomical at times . Quote Link to post Share on other sites
cde 334 Posted July 18, 2011 Share Posted July 18, 2011 To put it in a bit clearer, for other's sake, oPossum said to enable the SS pin, send multiple 8 bit packets (in this case 2), then disable the SS pin. The chip will treat this as a single 16bit packet. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.