Content originally posted in LPCWare by virtuPIC on Wed Jul 22 04:57:57 MST 2015
Okay, new observation. Two CS pins are used in GPIO mode anyway - these are working perfectly. I've configured the SSP pins also as GPIO outputs and trigger them in the hope to see a square wave on the scope:
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 5);
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 6);
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 7);
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 8);
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 9);
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 5, 1 << 7);
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 6, 1 << 7);
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 7, 1 << 7);
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 8, 1 << 7);
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 9, 1 << 7);
while (1)
{
vTaskDelay(1); // FreeRTOS delay by 1 ms
Chip_GPIO_SetPinOutLow(LPC_GPIO, 0, 5);
Chip_GPIO_SetPinOutLow(LPC_GPIO, 0, 6);
Chip_GPIO_SetPinOutLow(LPC_GPIO, 0, 7);
Chip_GPIO_SetPinOutLow(LPC_GPIO, 0, 8);
Chip_GPIO_SetPinOutLow(LPC_GPIO, 0, 9);
vTaskDelay(1); // FreeRTOS delay by 1 ms
Chip_GPIO_SetPinOutHigh(LPC_GPIO, 0, 5);
Chip_GPIO_SetPinOutHigh(LPC_GPIO, 0, 6);
Chip_GPIO_SetPinOutHigh(LPC_GPIO, 0, 7);
Chip_GPIO_SetPinOutHigh(LPC_GPIO, 0, 8);
Chip_GPIO_SetPinOutHigh(LPC_GPIO, 0, 9);
}
Now I'm getting 500 Hz on port 0 pins 5 and 6 but the other ones only switch from high to low only once after booting and stay there. (There seem to be pull ups on the bus.) This is really crazy.