PDA

View Full Version : need to blink



henery8
- 7th April 2006, 05:04
I can't get started with a 16F628. The blink model is for external crystal and I want to use internal OSC and /MCLR - nothing extra. We need to start but this fat monarch is stuck.

mister_e
- 7th April 2006, 06:01
first reading
http://www.picbasic.co.uk/forum/showthread.php?t=543

If you plan to blink on PORTA, read datasheet section 9 to know how to disable analog comparator.

henery8
- 7th April 2006, 09:15
Thanks Steve
It was a good lead and I've been trying to understand the configuration word from the pic manual. And I tried varous options but nothing actually flashed. I know my hardware is ok because I used another pic made with something else on it. My problem is that configuration word stuff seems quite advanced. As a beginner I don't know enough about pics to know what I need to set. It's simply lack of understanding. Chicken and egg ? Yes.

This is my best guesswork but not good enough


@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT
@ DEVICE pic16F628, WDT_ON
@ DEVICE pic16F628, PWRT_ON
@ DEVICE pic16F628, MCLR_OFF
@ DEVICE pic16F628, BOD_ON
@ DEVICE pic16F628, LVP_OFF

TRISB = %00000000
loop: High PORTB.2
pause 500
Low PORTB.2
Pause 500
Goto loop
End