cancel
Showing results for 
Search instead for 
Did you mean: 

st7 cosmic

sureshv_5
Associate II
Posted on March 02, 2004 at 01:17

st7 cosmic

4 REPLIES 4
sureshv_5
Associate II
Posted on February 25, 2004 at 02:36

st72264 data sheet is not having proper information about spi communcation. reg config is not supported by cosmic.

please help.
sjo
Associate II
Posted on February 25, 2004 at 05:41

There are no pre written peripheral libraries with cosmic (except eeprom), but ST do provide a ST7 library which gives examples for all the peripherals - both c and asm.

http://www.stmcu.com/mcdfiles/st7Lib_030227.exe

also have alook at

http://www.stmcu.com/mcdfiles/5697.pdf

code -

http://www.stmcu.com/mcdfiles/an970.zip

all available on this website.

Regards

sjo
sureshv_5
Associate II
Posted on February 26, 2004 at 07:38

Thanks, for your help.

I'm having confusion about spi regs. and their config. since the data sheet of st72264 is having some wrongs. it mentioned to write SPICSR reg first but contents mention under it is SPICR reg. which reg to be written first.

please help.

Regards

Suresh
jatin
Associate II
Posted on March 02, 2004 at 01:17

Hello,

You are right. For this, datasheet modification is already ongoing. Please find below the correct sequence-

To operate the SPI in master mode, perform the following steps in order (if the SPICSR register is not written first, the SPICR register setting (MSTR bit) may be not taken into account):

1. Write to the SPICR register: – Select the clock frequency by configuring the SPR[2:0] bits. – Select the clock polarity and clock phase by configuring the CPOL and CPHA bits. Figure 50 shows the four possible configurations. Note: The slave must have the same CPOL and CPHA settings as the master.

2. Write to the SPICSR register: - Either set the SSM bit and set the SSI bit or clear the SSM bit and tie the SS pin high for the complete byte transmit sequence.

3. Write to the SPICR register: – Set the MSTR and SPE bits Note: MSTR and SPE bits remain set only if SS is high).

[ This message was edited by: Jatin on 02-03-2004 05:48 ]