Hi, I am trying to make SPI1 working. I can see data on MOSI on the scope, but I don't see any clock signal. I am fighting with this for days. Any help will be appreciated. Here is my initialization code. VPBDIV = 0x0000; SSPCPSR = 0x0002; PINSEL0 |= 0x20000000; PINSEL1 |= 0x0540; SSPCR0 = 0x000007; //8-bit data, SSPCR1 = 0x0002; //enable SSP In the main code I am sending out data while (1) { n= SSPSR; if(( n & 0x0010 )== 0 ) SSPDR = 0xAA; }
Hi, did you ever check the sample code posted on the Philips website for the LPC213x/LPC214x? The SSP is the same so this should be very easy to port. http://www.standardics.philips.com/support/documents/microcontrollers/zip/code.bundle.lpc213x.lpc214x.uvision.zip Some additional hints for the LPC2103. You need to consider the Errata Sheet that you can find here: http://www.standardics.philips.com/support/documents/microcontrollers/pdf/errata.lpc2103.pdf In particular check out on page 4 Errata SSP1. Although this is not your issue at the moment it might become one if you want to go max. speed Last but not least a question that might seem unrelated but still, did you connect your vbat pins to a battery or to Vdd and Vss? If not, you want to do that. Vdd18 is good enough and can easily be connected. Do not leave Vbat open as this limits your max. speed. So please check in this order: 1. Compare sample code to your code or just incorporate the sample code 2. Check Errata 3. Make sure Vbat is connected. hth, Robert