PDA

View Full Version : Newbie problems, Can someone help me..



vaidyasp1
- 26th April 2006, 07:16
hi,

I am working with two controllers 16f84 and 18f4520. I use my picbasic pro compiler to compile following program. It works fine with 16f84 but does not work with 18f4520. For 18f4520 i have connected just vdd and vss pins. Is the circuit fine??

I also get a warning 230 while compiling the code for 18f4520. I think that is for the configuration bits.

I think my controller is not running at all. Because it cannot have the clock. so, i want to know the configuration bit settings for internal 8Mhz rc oscillator. So, how can i configure them. I use the EPIC programmer given from melabs. So, what should be the option for internal rc oscillator??
whether it should be INTRC Clockout or INTRC??


My very simple code was as below....
-----------------------------code-----------------------------------


OUTPUT PORTA.0

loop: High 0 ' Turn on LED connected to PORTB.0
porta.0 =0
high portb.3
Pause 500 ' Delay for .5 seconds

Low 0 ' Turn off LED connected to PORTB.0
low portb.3
porta.0=1
Pause 500 ' Delay for .5 seconds

Goto loop ' Go back to loop and blink LED forever
End

paul borgmeier
- 26th April 2006, 08:16
Oops - wrong button

Paul

mister_e
- 26th April 2006, 13:25
All about 'How to set config fuses http://www.picbasic.co.uk/forum/showthread.php?t=543

Also you'll need to disable all analog stuff on PORTA & PORTB (Comparator and A/D converter) : Datasheet Section 19.0 and 20.0

AND finnally you'll need to configure the internal oscillator speed as the default is 1MHZ : OSCCON register Section 2.6