Hi,
I didn't have a 16F628A only a non A-version but I don't think the differences matters here (they are covered in Appendix C of the datasheet).
First take a look at the schematic:
With the above setup I wrote a short program, no more no less than:I programmed the PIC and the LED blinked at 2Hz - it really can't get easier than that IMO and it certainly isn't harder than on a BasicStamp. It works because I built the hardware to match the default setup, ie using an external 4MHz x-tal.Code:Main: Toggle PortB.0 Pause 250 Goto Main
Next thing I did was open up the .info file for the device and copied the default configuration from where it says The PBP default configuration for the PIC16F628 is: and pasted that into my program. I then read thru the available options and decided that I want to use the internal oscillator without feeding the clock out and use internal MCLR so I changed my program to:I removed the pullup on MCLR and the x-tal, programmed the PIC and the LED blinked with a frequency of 2Hz - as expected. All I have on the breadboard is a bypass cap, a 16F628, a resistor and a LED.Code:#CONFIG __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF #ENDCONFIG Main: Toggle PortB.0 Pause 250 Goto Main
/Henrik.




Bookmarks