This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem with MISO pin SPI

I am using SPI to transfer data between an ADC and my NRF52 (the spi master) on a custom made pcb device. I call the SPI data transfer in a BLE_UART example (from the SDK 15.2, in Embedded Studio) because I need to use the ble_uart's ble_nus_data_send () function to transmit the ADC hex array to a mobile app via bluetooth. To keep it short, I am facing the same problem this guy had: https://devzone.nordicsemi.com/f/nordic-q-a/28683/spi-miso-problem but this ticket was never solved and it's now locked so I can't comment. Difference is that my peripheral device is an ADC ADS1220. 

CLK (p0.7), CS (p0.6), MOSI (p0.8), DRDY (p0.10) are working as they should as seen in an oscilloscope. MISO pin (Pin 9 on my nrf) fixed to a DC voltage of 3.3 V (when it should be a digital pulse since my MISO is the output of my slave ADC device) and I receive "0xFFFFF...".... through SPI. 

I have tried almost everything they recommend to unclog pin 9: 

1. CONFIG_NFCT_PINS_AS_GPIO in processor definitions (I'm using Em Studio)

2. Added the "const uint32_t UICR_ADDR_0x20C    __attribute__((at(0x1000120C))) __attribute__((used)) = 0xFFFFFFFE" line in the uicr_config.h file and added the file to the folder my main.c is. 

3. Went to the project makefile and added line "CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS"

But nothing worked.
I have run SPI communication on the same board with the same pins before so I know it cannot be a hardware issue. And I'm also confused because if this is an NFC pin issue why is pin 10 working? Is it because I don't mention or use pin 10 anywhere in the software? 

I am working on a tight timeline so any suggestions at all are welcome! Thank you! 

Parents Reply
  • I tried using another pin for MISO (pin P0.17 and then pin P0.3) but the MISO behaves strangely even with these pins. I don't think the problem is that the NFC config is still there. 

    When I configured pin 17 and 3 as MISO (I converted my set up to the Dev Kit) the MISO is pegged to 1.25 V instead (in case of both pins). Which is unnatural for the spi miso. I receive a data array of "0x-OC-00-00-00-00-FF-FF-FF-FF" instead. 

    When I use SPI MODE_0 instead of MODE 1. I get "0x7FFFF" as data. (but  I am sure the ADC is not compatible with modd 0)

Children
Related