CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

constant 1hz output with state machine

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
david90



Joined: 25 Feb 2006
Posts: 23

View user's profile Send private message

constant 1hz output with state machine
PostPosted: Mon Nov 17, 2008 12:02 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Nov 17, 2008 12:10 pm     Reply with quote

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).
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group