Chat freely about anything...

User avatar
By ESP1990
#54038 I am having a weird problem in the user_init main function. I have a small code as shown below

Code: Select allcs_enable();
    spi_tx8(spinum,cts_check_cmd);
    cts_byte = (unsigned char)spi_rx8(spinum);
    cs_disable()


The problem is, the above only works when I put it in a while(1) loop within the user_init function, which executes these lines repeatedly and I can see the pulses on the DSO. The weird part is, the above does not work when called just once within the user_init main. It only works when executed within a while(1) loop.

I need to execute the above statements just once during initialization and capture the signals in the DSO which I am able to do so only when executed within a while(1) loop. What am I missing and why it work only when called repeatedly in while loop?

Between, I am not using any rtos. Doing the above using non os sdk.