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

generate 120kHz + zerocrossing detect+emergency
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Sep 19, 2006 5:44 pm     Reply with quote

You didn't tell us what is and what isn't working in your new program so I don't know if there is a problem, and if yes what to look for.

An improvement to your program is to clear the timer0 before enabling it, change
Code:
    Xout=0;    //enable 120khz output.
    enable_interruptS(INT_timer0);// Timer0 is used to time the duration of the 1ms 120kHz burst.
to
Code:
    Xout=0;    //enable 120khz output.
    set_timer0(0);
    enable_interrupts(INT_timer0);// Timer0 is used to time the duration of the 1ms 120kHz burst.



Some more tips:
- An error in the int_ext routine is that you are testing the value of TxBit before it has been initialized.
- Do you know there exists a standard rotate_left() function similar to your RotateTxData()?
- You are incrementing the boolean variable ext_edge. This ought to work, but using the bit_toggle() function is more to the point and makes for easier reading.
- Add an endless loop at the end of your main() or the processor will execute the sleep processor that the compiler puts there and transmission will stop.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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