Please help 18F252 programming

Status
Not open for further replies.

peterzatko

New Member
I have problem with programming .Code is in mikroBasic Pro see attachment.Its program with logicall function.In proteus work hex good but when i burn hex to pic18F252 and get them to pcb ,pic not working.On the start must be two leds switch on.But nothing.On pin 1 is 5V and other supply are OK.In Proteus is OK.When I burn pic LVP is disabled.
 

Attachments

  • Logic gates generator.asm
    20.5 KB · Views: 108
  • generator.JPG
    212.4 KB · Views: 325
Last edited:
are you using internal rc oscillator or external crystal? about 90% of problems are with config bits and clock .
 
yeah, mikro C generate hex files which has no config bits. which programmer do you use? is its pickit?
 
how do you program the pic? which programmer are you using? is it the programmer that comes with mikro basic?
 
OSCILLATOR
CONFIGURATIONS
2.1 Oscillator Types
The PIC18FXX2 can be operated in eight different
Oscillator modes. The user can program three configuration
bits (FOSC2, FOSC1, and FOSC0) to select one
of these eight modes:
1. LP Low Power Crystal
2. XT Crystal/Resonator
3. HS High Speed Crystal/Resonator
4. HS + PLL High Speed Crystal/Resonator
with PLL enabled
5. RC External Resistor/Capacitor
6. RCIO External Resistor/Capacitor with
I/O pin enabled
7. EC External Clock
8. ECIO External Clock with I/O pin
enabled
refer datasheet..
 
111 = RC oscillator w/ OSC2 configured as RA6
110 = HS oscillator with PLL enabled/Clock frequency = (4 x FOSC)
101 = EC oscillator w/ OSC2 configured as RA6
100 = EC oscillator w/ OSC2 configured as divide-by-4 clock output
011 = RC oscillator
010 = HS oscillator
001 = XT oscillator
000 = LP oscillator
 
proteus and real world simulation are entirely different.there is no need to use the resistor network in case of proteus, the data is already therein the properties window. so in real worldapplication,,, if you use the rc oscillator for clock please refer page # page 18 of https://www.electro-tech-online.com/custompdfs/2011/09/39564c.pdf. the oscillator frequency must be supplied to the MCU for its normal functioning. generally we use HS and LP modes. in your application RC is enough, so refer page 18 of the above said pdf. read from page # 197 for further congig bits types and how to enable that. generally we disable all of the bits and enable only the code protect bit happy burning!!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…