PDA

View Full Version : 18f452 Problems



mglazer
- 25th October 2005, 12:46
Hi, I have been using the 16f84a no problems at all now I've upgraded to the 18f452 and cannot even get a LED to flash. I have searched the forums and made sure the OSC setting are correct and set to HS for a 20mhz resonator.

I have been trying for the last 6 hours with no luck and tried another pic just incase the one I had was a dud. I've attached a very crude circuit diagram incase I have done something wrong. I have also tried a crystal in place of the resonator.

Thank you for any help that you can give.

mister_e
- 25th October 2005, 17:32
what about if you place the following lines at the top of your code



@ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
' Oscillator switch OFF
' Use HS oscillator (20MHZ here)
'
@ __CONFIG _CONFIG2L, _BOR_ON_2L & _PWRT_ON_2L & _BORV_45_2L
' Brown out reset ON @ 4.5Volts
' Power-up timer ON
'
@ __CONFIG _CONFIG2H, _WDT_ON_2H
' Watch dog timer ON
'
@ __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
' Stack over/underflow ON
' Low Voltage programming OFF
' Background debugger OFF

DEFINE OSC 20


Be sure you correctly disable analog or multiplexed stuff on the I/O you're using for your LED.

mglazer
- 26th October 2005, 04:15
Thanks for your reply, It pays to just walk away and try tommorow when you are tired. The problem was the ZIF socket was not fully pressed into the bread board.

I feel like such an idiot.

Thanks for your help.