Society of Robots - Robot Forum

Software => Software => Topic started by: galannthegreat on January 30, 2009, 12:08:23 PM

Title: Help with setting MCU clock settings
Post by: galannthegreat on January 30, 2009, 12:08:23 PM
can i use the statement "#use delay(20000000)" to get my MCU clocked at 20MHz with a crystal or do i have to set it to HS mode?
Title: Re: Help with setting MCU clock settings
Post by: pomprocker on January 30, 2009, 01:56:05 PM
First off, What MCU are you using? Please provide the appropriate amount of information.
Title: Re: Help with setting MCU clock settings
Post by: galannthegreat on January 30, 2009, 02:09:34 PM
PIC 16F877a
20 MHz crystal
I'm using the CCS C compiler
Title: Re: Help with setting MCU clock settings
Post by: Admin on February 13, 2009, 12:30:26 AM
I could be wrong as its been ~2 years since I've used CCSC, but I remember that the delay for CCSC is a 16 bit variable. Just look up the delay function in the manual you got with CCSC when you bought it.

So you can't go above delay(65535)

If you wanted more, just do this:

for(i=0;i<21;i++)
     delay(50000);