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 support@ccsinfo.com

PIC18F4620 at 40MHz

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

PIC18F4620 at 40MHz
PostPosted: Thu Jan 29, 2009 1:02 pm     Reply with quote

How can i drive PIC18F4620 at 40MHz? Could you send me some example_? How can i use the PLL for 40MHz or 32Mhz_?
_________________
MurtiS
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 29, 2009 1:12 pm     Reply with quote

Code:
#define FIRM_MAJOR 'E'
#define FIRM_MINOR  1
#define HARD_MAJOR  3
#define HARD_MINOR  3
//#include <18F4525.h>
#include <18F4620.h>
#use delay(clock=40000000, restart_wdt) //note the crystal is 10Mhz
#fuses h4,nowdt,noprotect,nolvp,put   //note h4 is 4x pll must power off to reset pll
#use rs232(baud=19200,xmit=PIN_C0,invert,stream=DEBUG) // stderr(same as debug)
#use rs232(baud=19200,enable=PIN_C5,xmit=PIN_C6,rcv=PIN_C7,stream=CIM)  // rs485 is the default
#case
#zero_ram
#include <flex_lcd.c>  //can be used with lumex S011602 or Optrex DMC16202NYJ

//=== MAIN ===//
void main(void)
{
  setup_adc_ports(NO_ANALOGS);
  setup_adc(ADC_OFF);
  set_tris_a(0xFF);set_tris_e(0xFF);set_tris_c(0xFF);
  set_tris_b(0xFF);set_tris_d(0xFF);port_b_pullups(TRUE);
  fprintf(DEBUG,"Firm=%C_%03u.c\n\r",FIRM_MAJOR,FIRM_MINOR);
  fprintf(DEBUG,"Hard=%u.%u\n\r",HARD_MAJOR,HARD_MINOR);
  lcd_init();
  while(1)
  {
  }
}
Guest








PostPosted: Thu Jan 29, 2009 10:04 pm     Reply with quote

Here is another way,

#use delay(clock=40M, oscilator=10M)

The compiler will set the H4 config bit for you....

HTH - Steve H
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Jan 29, 2009 11:31 pm     Reply with quote

Anonymous wrote:
Here is another way,

#use delay(clock=40M, oscilator=10M)

The compiler will set the H4 config bit for you....

HTH - Steve H


This is version dependent
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
murtis



Joined: 12 Aug 2007
Posts: 41

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Tue Mar 31, 2009 3:46 pm     Reply with quote

asmallri wrote:
Anonymous wrote:
Here is another way,

#use delay(clock=40M, oscilator=10M)

The compiler will set the H4 config bit for you....

HTH - Steve H


This is version dependent


I use the ICD-U40 debugger. 10MHz Xtal is used on my hardware design. When i started debugger module on PCWHD, i see the some information at the bottom of the debugger screen that is "Ready MCU at 10.00MHz". My question is that PIC18F4620 is working at 40MHz or 10MHz. Which one is true for me_?

Thanks for your solution offering me....
_________________
MurtiS
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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