Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] tried programming pic18f4520 and its programmed but not working??

Status
Not open for further replies.

Deexith Hasan

Advanced Member level 4
Joined
Oct 24, 2014
Messages
111
Helped
4
Reputation
8
Reaction score
3
Trophy points
18
Activity points
740
Programmed pic18f4520...ie led blink but even that too not executing. But its programmed, i'm 100% confident.........
what may be the problem?......i have done led blink on proteus and working fine but not on real pic.....
 

What IDE/Compiler are you using? Have you checked your hardware connections? If you are confident with your hardware and code, check if you have programmed your configuration bits correctly.
 

HI TECH COMPILER......yup its a development board.......
i have not attached any config bits...give some syntax about default config bits..
 

Want to tell us which development board?
Want to tell us what config settings you have written and what the syntax errors are?
What crystal are you using are are you using an internal oscillator? Are you sure that it is working and configured correctly?
What speed are you flashing the LED? Is it too fast to see with a low duty cycle?
Perhaps showing us your code might help?
Susan
 

I dont have the development board name......
using 20Mhz external crystal oscillator
1 sec delay blink program......no errors and programmed pic18f4520 using winpic800 and verified everthings good...mclr connected to vpp inside the dev board itself....
but i didnt wrote any CONFIG bits
no led is blinking on my dev board......
 

Is this what you are using? https://www.rakeshmondal.info/winpic800-config-for-JDM-Programmer
Post your settings for the Oscillator here so we can check (you can see on the page that it says to set the oscillator options in software settings - those are the config bits we mentioned). If HI TECH is your compiler, what is your IDE (where do you write your code)? Are you using Microchip's MPLABX?
 

Depending on your settings, the system clock will by default be set to the primary oscillator (external clock crystal) instead of the internal fast RC oscillator (FRC). So check the "Special Features of the CPU" section of the datasheet for the correct config bits to set.

Also, make sure you have a 10k resistor connected to the MCLR line to pull it up to VCC, otherwise the MCU will be kept in reset forever.
 

I'm using HI-TECH compiler and set config bit for external oscillator RA6 as clock source i'm having 20Mhz crystal in dev board.....Now programmed using winpic800 there also i set config to external RA6...led blink for 500ms approx...but the output is 5 sec led blink....i thought there may be some problem in crystal...
now i set config bits to INTERNAL clock and same in winpic800 and programmed but go the o\p as 1.30 sec led blink why??
 

Such large derivations in crystal frequency are highly unlikely, I rather suspect erroneous PLL or prescaler settings. Check these registers and make sure they're set to 0 (disabled).
 

... and set config bit for external oscillator RA6 as clock source i'm having 20Mhz crystal in dev board....
I think you need to be very careful with the language here: an "external oscillator" has the specific meaning that you have a completely external clock source that has a single line leading in to the OSC1 pin. This is set with the FOSC config bits being EC or ECIO (and your mention of RA6 means this is the option you have set)
On the other hand, if you are using a crystal oscillator (and you mention a 20MHz one which would need FOSC to be set to either HS or HSPLL depending on whether or not you want to use the PLL) then the crystals is connected between OSC1 and OSC2 (as shown in figure 2-1 in the data sheet) with the capacitors to ground.
If you have a mis-match between the hardware connections and the FOSC settings then you can get all sorts of 'strange' things happening with the system clock.
You then talk about the internal clock but that can be set (using the OSCCON register bits) to generate a range of frequencies from 32KHz to 8MHz. Of course which one you have selected (with the power on default being 1MHz) will have a bit difference on how fast the LED will blink (all other things being the same).
I think that you really need to tell us the actual hardware configuration (using the terms as in the data sheet) and also your code so we can see what has been set and what has been left as 'default' values.
Susan
 
thank u susan i had wrongly config as external osc now working......thanks a lot...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top