go away spammer

Author Topic: Help with setting MCU clock settings  (Read 3016 times)

0 Members and 1 Guest are viewing this topic.

Offline galannthegreatTopic starter

  • Supreme Robot
  • *****
  • Posts: 615
  • Helpful? 4
  • Blue-Lensed Blue LEDs?! What?! Impossible!!
Help with setting MCU clock settings
« 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?
Kurt

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Help with setting MCU clock settings
« Reply #1 on: January 30, 2009, 01:56:05 PM »
First off, What MCU are you using? Please provide the appropriate amount of information.

Offline galannthegreatTopic starter

  • Supreme Robot
  • *****
  • Posts: 615
  • Helpful? 4
  • Blue-Lensed Blue LEDs?! What?! Impossible!!
Re: Help with setting MCU clock settings
« Reply #2 on: January 30, 2009, 02:09:34 PM »
PIC 16F877a
20 MHz crystal
I'm using the CCS C compiler
Kurt

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Help with setting MCU clock settings
« Reply #3 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);

 


Get Your Ad Here

data_list