Cannot directly configure register??

General discussion on mikroBasic PRO for ARM.
Post Reply
Author
Message
zmEE22
Posts: 4
Joined: 04 Aug 2022 16:54

Cannot directly configure register??

#1 Post by zmEE22 » 04 Aug 2022 19:03

I am trying to configure UART0 on the MK64FX512VLQ12 mcu, but it keeps hanging when I got to write settings into a register. I use the register naming scheme found in the defs for the chip, but it hangs on the write. When I go into debug and step into it I have no problems and I can see the registers update with the setpoints I wanted.

I zipped up my code and attached it.

Thanks for any help.
Attachments
UART Code.zip
(845 Bytes) Downloaded 42 times

Alessandro Fulignani
Posts: 101
Joined: 04 Nov 2016 13:09

Re: Cannot directly configure register??

#2 Post by Alessandro Fulignani » 10 Aug 2022 08:48

Hi zmEE22,

Did you try to identify which one of the 4 lines code is hanging the software?

Did you turn on the UART0 Clock? Because i don't see it... ( It is SIM_SCGC4 )

Did you try, once in debug mode, to run the code at full speed and see if you get a "stack error" (don't remember the exact name)due to a wrong access to the memory?

Let me know..

Alex

zmEE22
Posts: 4
Joined: 04 Aug 2022 16:54

Re: Cannot directly configure register??

#3 Post by zmEE22 » 17 Oct 2022 18:09

Sorry for the late reply, but that was indeed the problem. I did not realize the clock gates are off by default. Enabling them allowed me to configure the registers.

Thank you!

Post Reply

Return to “mikroBasic PRO for ARM General”