Hi, I am interfacing ST10F269 with MCP2515 via SSC module. Please see the routines as below, i am still not able to read valid values from register CANCTRL at address 0x0F. i wish to upload the waveforms but dont see an option here.
initialisation routines : NOP BSET DP3.6 ;Chip Select BSET P3.6 BCLR DP3_8 ;MRST pin BCLR P3_8 BSET DP3_9 ;MTSR pin BSET P3_9 BSET DP3_13 ;SCLK BSET P3_13 MOV SSCBR, #0x00C7 ;100K baudrate BCLR SSCEN MOV SSCCON, #0x4077 BSET SSCEN ENIT CODE : #define MCP_SELECT() (P3_6 = 0) #define MCP_DESELECT() (P3_6 = 1) unsigned int spi_readwrite(BYTE data) { int test = 0; SSCTB = data; //Byte in Sende buffer while(SSCBSY == 0);//wait till SSCBUSY becomes 1 i.e. when transmission starts SSCBSY becomes 1 while (!SSCRIR); //wait till byte is sent(SSCRIR = 1) SSCRIR = 0; //clear the flag return SSCRB ; } unsigned int spi_read(void) { return (spi_readwrite(SPIDONTCARE)); //return SSCRB ; } CALLING FUNCTIONS : MCP_SELECT(); spi_readwrite(0x03); //MCP_READ = 0x03 spi_readwrite(0x0F); status_register = spi_read(); MCP_DESELECT();
Please let me know if i am doing something wrong. Its very urgent.
Rgds Sany
no its not in hi-impedance state but its showing the same signals as the SI line HOWEVER the voltage level is too suppressed.(a few mV). The uC reset is also inverted logic...the uC is ST10F269.
now i tried another thing, i connected the reset of MCP to one of the port pins P3.5 but when i toggle this pin i get 3.5V for low level and 5V for high level.i think the low level is not sufficient enough to give a reset. anyways i think this is a different issue.
and hey thanx a very lot for replying. i really really appreciate it.