I want my uC to output a 1hz signal to an LED to show that it is stepping through the code (for debugging), but I'm not sure how to do it properly when my program is a Moore state machine.
It would work if I put the 1hz code in every state but it is messy. What's a good to do this?
Thanks!
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Mon Nov 17, 2008 12:10 pm
It would be easier to drop a putc() statement in each state.
You could set the hardware UART's baudrate to 115200 bps
and it would only take 86 us to send a character. As long as
your states took at least that amount of time, you wouldn't see
any delay added to them.
In other words, this is the quick "no brainer" way to do what
you want (ie., to track state progress).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum