problem programming pic microcontrollers

tshuck

Joined Oct 18, 2012
3,534
Problem solved!! it was OSCCON = 0x60; missing from the code...! i write it and i program again the pic and everything now works!! thank you a lot!!!
OSCCON, in this case, should have no effect on whether or not the LED blinks.

Were you recompiling the *.c file each time you programmed the device?
 

JohnInTX

Joined Jun 26, 2012
4,787
OSCCON, in this case, should have no effect on whether or not the LED blinks.
Except that each cycle would take about 4+ minutes. Long time to wait around if you're not expecting it.

For the TS, was it just OSCCON or did you do any of the other stuff as well? Just curious. Good job anyway.
 

Thread Starter

gatoulisss

Joined Jan 23, 2015
69
no i just add the line OSCCON = 0x60; in the code and work as i wanted...
one more question, pic16f84a needs crystal Oscillator to work... does the same happens with pic16f628a??
 

JohnInTX

Joined Jun 26, 2012
4,787
The 16F628A has an internal 4MHz oscillator that is enabled by the CONFIG bits. Instead of OSCCON, it uses PCON.OSCF - see 4.2.2.6 in the datasheet - to select internal oscillator frequencies but it defaults to 4MHz unlike the 16F88 which defaults to 31.25KHz.
 
Top