Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: mcdanne82 on February 18, 2010, 09:23:30 pm

Title: How to get the delayUS to work?
Post by: mcdanne82 on February 18, 2010, 09:23:30 pm
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??
Title: Re: How to get the delayUS to work?
Post by: robots on February 19, 2010, 09:55:09 am
are you sure with the 2340550029 ? To me it seems like ~2.340 GHz :)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.00852037904session_write_close ( )...(null):0
20.00882169480ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00882170256Database_MySQL->query( ).../DatabaseHandler.php:119
40.05322308976Database_MySQL->error( ).../Db-mysql.class.php:273