Having a bit of a problem, for which I've logged a service request. Thought I'd share so if anybody else is trying to use SPI0 module with the default PORTB pins, they'll know whats wrong. Stumbled onto the fact that trying to use the SPI0 module creates a problem if the NMI is still enabled in SIM SOPT0. It defaults to on, and it does not automatically turn off if the SPI module is enabled. NMI shares the PORTB4 pin with SPI0_MISO. Since I'm using MQX, Processor Expert has the NMI enabled by default. Trouble is, it's a write once bit. It turns out if I uncheck the NMI checkbox in the CPU configuration, it is still defined, so I've had to modify cpu_init.c to make sure it disables NMI.
Solved! Go to Solution.
Hi Erich, I was able to fix it. I didn't know there were two different checkboxes for disabling the NMI. One under Common Settings, and one under CPU interrupts/resets. Now it seems to be working without my modification. I had just added #undef CPU_NMI_PIN before the statement that checks for it.
Hi David,
can you share your modification in CPU_Init.c?
For me, it disables the NMI pin in PE_low_level_init() with the CPU_NMI_PIN set to 0x00U in CPU_config.h:
#if CPU_NMI_PIN
SIM_SOPT0 |= (uint32_t)SIM_SOPT0_NMIE_MASK; /* Enable NMI pin */
#else
SIM_SOPT0 &= (uint32_t)~(uint32_t)SIM_SOPT0_NMIE_MASK; /* Disable NMI pin */
#endif /* CPU_NMI_PIN */
Regards,
Erich
Hi Erich, I was able to fix it. I didn't know there were two different checkboxes for disabling the NMI. One under Common Settings, and one under CPU interrupts/resets. Now it seems to be working without my modification. I had just added #undef CPU_NMI_PIN before the statement that checks for it.