Hi! I have problems with mcb2100 !Iam trying to use SPI on this board,sck is working well but problem is, that i don't ever get anithing in S0SPDR or out of this register.Is it posibel that i physically destroyed MIOS pin on chip!i have external pullups on SSEL! This is the code!
#include "lpc21xx_keil.h" int main(void) { int i; PCONP |= 1<<8; S0SPCCR = 0X80 ; PINSEL0 |= 0x5500; S0SPCR |= 1 << 4; S0SPCR |= 1 << 5; while (1) { while (!(IOPIN0&0x20)){} //(MISO mora biti 1) must be 1 S0SPDR = 0x0; //start SPI transfer 1st byte while (!(S0SPSR & 0X80)){} // cakaj na koncan SPI transfer i=S0SPDR; } }
Have you looked at your signals with an oscilloscope ? Check your chip select signal and your clock. Then look at your MOSI and MISO. Be sure you respect the slave's protocole described in its datasheet (clock polarity, CS...). To begin, try to read the slave register status for exemple.
Yes i have already looked at the signels with an oscilloscope and clock is working fine!Then i tryed to use pin P0.5 (pin 29 on chip) as a GPIO and it isn't working as a GPIO as well!I also measureed it when pulluped and ther is only 1.7V on it?
I think your SSEL need to be pulled up (a real pull up 3v3) if the LPC is the master and you could use any GPIO as a chip select. As your CS is not working fine, you can't use SPI, even if the clock looks good.
If you get 1.7V on one signal: Have you configured so both sides are SPI masters and trying to drive the signal? You must make one side the SPI master, and one side the SPI slave.