|
|
View previous topic :: View next topic |
Author |
Message |
murtis
Joined: 12 Aug 2007 Posts: 41
|
PIC18F4620 at 40MHz |
Posted: Thu Jan 29, 2009 1:02 pm |
|
|
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
|
|
Posted: Thu Jan 29, 2009 1:12 pm |
|
|
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
|
|
Posted: Thu Jan 29, 2009 10:04 pm |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Thu Jan 29, 2009 11:31 pm |
|
|
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
|
|
Posted: Tue Mar 31, 2009 3:46 pm |
|
|
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 |
|
|
|
|
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
|