> I have a PIC16F88 chip I'm trying to wire up on a breadboard to flash > an LED, running the internal RC oscillator. I'm using the B Knudsen > CC5X compiler with MPLAB. The Config word is 3FD0h. I have WDT off, > PWRT on, MCLR off, BODEN on, LVP on, CPD off, Debuger off, and CCPMX > is on. Below is some absolute assembly code that simply blinks an LED on RB0. It's not C, but it's simple to understand, and it has the proper config to use 8MHz intRC. -Scott ; Title: blink88.asm ; Author: Scott Larson ; Date: Jan 2 2006 ; Version: 0.1 ; PIC: 16F88 ; Description: LED blinker, portb.0 ; 8MHz internal RC ; ;****Include and config**** include "P16F88.INC" __CONFIG _CONFIG1, _CP_OFF&_WDT_OFF&_PWRTE_ON&_INTRC_IO&_MCLR_OFF&_LVP_OFF ;*****Set up the Constants**** COUNT1 equ 20h ;First counter for Pause COUNT2 equ 21h ;Second counter for Pause COUNT3 equ 22h ;Third counter for Pause BSHADOW equ 23h ;shadow register for PORTB ;****Set up PORTB as output, which will remain output**** banksel TRISB ;switch to bank 1 clrf TRISB ;Set PORTB to output. banksel PORTB ;Switch back to Bank 0 ;****flash LED**** Start banksel OSCCON ; movlw b'01110000' ;8MHz intrc movwf OSCCON banksel PORTB LOOP bsf BSHADOW,0 ;use shadow register movfw BSHADOW ;to solve the RMW problem movwf PORTB ;turn LED at pin0 on call Pause ;pause clrf PORTB ;turn LED off clrf BSHADOW bsf BSHADOW,1 movfw BSHADOW movwf PORTB ;turn LED at pin1 on call Pause ;pause clrf PORTB clrf BSHADOW goto LOOP ;loop ;****Pause subroutine Pause movlw 03h ;Change this number to change the length of Pause movwf COUNT3 movlw 0ffh movwf COUNT1 movwf COUNT2 Pause1 decfsz COUNT1,1 goto Pause1 decfsz COUNT2,1 goto Pause1 decfsz COUNT3,1 goto Pause1 return end On 1/13/07, Paul Anderson wrote: > I have a PIC16F88 chip I'm trying to wire up on a breadboard to flash > an LED, running the internal RC oscillator. I'm using the B Knudsen > CC5X compiler with MPLAB. The Config word is 3FD0h. I have WDT off, > PWRT on, MCLR off, BODEN on, LVP on, CPD off, Debuger off, and CCPMX > is on. > > I programmed the chip using the Olimex PG4 with the ICSP header and > icprog on an XP system. It wrote and verified successfully. I > disconnect the programmer, and wire up a 7805 with a cap going from > it's output to ground. Wire up Vdd to +5v, Vss to gnd. I have an LED > on pin 1, through a 470 ohm resistor to gnd. I checked with a > voltmeter and the regulator is outputting 5.07v. When I apply power > to the circuit, the LED may or may not stay lit or flicker. It seems > most acutely affected by running my finger underneath breadboard where > the chip is sitting, and the response of the LED is somewhat random. > > Any thoughts on why it's not running? I can supply the code I'm > using, it's from Spark Fun's blink.c, but modified to use with the F88 > and CC5x. All help is greatly appreciated. > > -- > Paul Anderson > VE3HOP > wackyvorlon@gmail.com > http://www.oldschoolhacker.com > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Scott Larson 1136 W. Oakdale Apt. 1 Chicago, Il, 60657 619-400-9775 http://goldscott.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist