Got this project when the developer working on the project moved to another company (A good opportunity he couldn’t pass up)
Uses the GHI G400D SoM module
Existing PCB layout and has been populated and deployed (No option to change)
Needed external real-time clock (RTC) for more accurate time over years of operation. (could be running for 5+ years)
Not using the Gadgeteer library
NETMF v4.3
##Issue:
The needed external RTC is interfaced with SPI 1 and the documentation specifically recommends to use SPI 2 but I can’t change the hardware because the PCB is already populated and shipped. I was trying to use the Microsoft.SPOT.Hardware API to set up and talk to the RTC but it freezes the current screen and will not change after attempting to communicate with the RTC. Since I am debugging the system I see responses that imply the module is still running and hasn’t crashed but I can’t seem to solve the issue.
Has anyone been successful with using SPI 1 to communicate with any devices?
So I just wanted to drop the code snippets on the tread to show what I am doing for initialization. Either I am missing something or I am using something incorrectly.
I have tested the real-time clock using an Arduino Genuino/Uno to verify that the PCB layout for the RTC was correct and function.
Side note in case it helps: We are using RLP for a screen but looking at the pins I didn’t think they could interfere. They do use the LCD RGB pins, SPI 2 MISO and MOSI, and GPIO PD3, PD5, and PD6
So looking into it, the scope images verify that it is correct (not posted) and everything is sending correctly BUT I did find out that my SPI MISO pin goes low and then my chip freezes. After I power cycle the device it all of a sudden goes into boot loader mode and I have to power cycle the unit again.
Looking from the documentation, to update the bootloader you have to pull that pin low. So I’m assuming it would be fair to say that I cant use this port?
If your RTC chip is driving MISO low on startup while not selected, then you are correct, you can’t use it. Since on power up you haven’t initialized the chip select pin in NETMF yet, it is floating by default so your device may think it is spuriously selected and drive MISO. To get around that, you should make sure to have a proper pull up resistor on the CS line.