This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi,
I need help with SPI (Motorola 3-wire with separate CS lines to 2 peripherals) on custom board. I'm sending data to my slave device but the received data on MISO is always 0xff. Am I setting the ChipSelect pin as GPIO output correct? I want to use PA9 and PA3 as GPIO output pins and assign them as SPI Chip Selects for my 2 slave devices.
Please see my sample code. Thanks for the help.
DL_GPIO_initDigitalOutput(GPIO_PORTA_PA9_IOMUX);
DL_GPIO_initDigitalOutput(GPIO_PORTA_PA3_IOMUX);
DL_GPIO_setPins(GPIO_PORTA_PORT, GPIO_PORTA_PA9_PIN | GPIO_PORTA_PA3_PIN );
DL_GPIO_enableOutput(GPIO_PORTA_PORT, GPIO_PORTA_PA9_PIN | GPIO_PORTA_PA3_PIN);
If the receive data is 0xFF, is it possible that the slave setup has some problem. For the GPIO control, I would suggest you to used sysconfig to do the GPIO configuration.
Can you post the wave captured by the oscilloscope?
Hi,
For SPI0 setup, I'm using "Motorola 3-wire" with SCLK=PA11, PICO=PA5, POCI=PA10.
Then in GPIO of syscfg, I configure #1 chip select pin (PA9) as GPIOs (see 2nd screenshot), also did similarly for #2 chip select pin (PA3) in the same Group GPIO_PORT_A.
So what is the problem? Can you post the wave captured by the oscilloscope?
See from your post information, I can't find any error.
Here's the Picoscope capture. I'm driving the CS pin (PA9) low but not sure why it's toggling around +-0.5V instead of stay low.
DL_GPIO_clearPins(GPIO_PORTA_PORT, GPIO_PORTA_PA9_PIN);
Noise on the line, it is too low to register as a valid "1" so no harm done, it comes under the heading of "noise immunity".