1. Save the following code as MyTest.BAS into your PBP directory...
2. Compile (approx 67 words) by opening up a DOS box, logging into the PBP directory and from it use the command line...Code:' ' Device Programming Options ' -------------------------- @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT ' System Clock Options @ DEVICE pic16F628, WDT_ON ' Watchdog Timer @ DEVICE pic16F628, PWRT_ON ' Power-On Timer @ DEVICE pic16F628, BOD_ON ' Brown-Out Detect @ DEVICE pic16F628, MCLR_OFF ' Master Clear Options (Internal) @ DEVICE pic16F628, LVP_OFF ' Low-Voltage Programming @ DEVICE pic16F628, CPD_OFF ' Data Memory Code Protect @ DEVICE pic16F628, PROTECT_OFF ' Program Code Protection ' ' Hardware Assignments ' -------------------- LEDA var PortA.0 LEDB var PortB.0 ' ' Initialise PIC ' -------------- TRISA=%00000000 ' PortA all OUTPUT TRISB=%00000000 ' PortB all OUTPUT CMCON=%00000111 ' Comparators OFF ' ' Main Program ' ------------ Loop: Toggle LEDA Pause 500 Toggle LEDB Pause 500 Goto Loop ' End
PBP -p16F628 MyTest -v
3. Program your PIC...
Results...
1. If it fails to Compile you have a bum PBP installation
2. If it fails to compile you may not have logged into your PBP directory
3. If it compiles but doesn't program you have a bum programmer/software
4. If the PIC does not run, your programmer may have changed the CONFIG Fuse Settings - check this before you hit the BURN Button...
5. If the PIC does not run you have a Bad PIC or have forgotten to pay your electric company.
6. I'm making assumptions you can wire Vss and Vdd to your PIC (MCLR or xtal/resonator not required), and that you can hang an couple of LEDs with a Series Resistors (any value between 180R-390R) between the approprate PIC pin and Vss (or Vdd), and you can figure which way around to nail it.
A program compiled for a 16F628 will happilly burn into an 'A' version without needing recompilation.




Bookmarks