Skip to main content
Topic: How to get the delayUS to work? (Read 985 times) previous topic - next topic

How to get the delayUS to work?

Hi
I am quite new to the C langue.
How do I get the delayUS to give the right values?
I have included the "libpic30.h" file, and what I understand I should change
#define FCY 40000000UL after the PIC clock.
But if I change it so the timing in practice is correct to __delay_us(100)  =  100us then I need to change the value to  #define FCY 2340550029UL
But then I get totally wrong timing when I use __delay_us(10)
That gives a timing around 50uS

I using the “TCP Demo App-C30”
What am I doing wrong??

Re: How to get the delayUS to work?

Reply #1
are you sure with the 2340550029 ? To me it seems like ~2.340 GHz :)