Searching \ for '[PIC] Help! 16F88 Not Running on IntRC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'Help! 16F88 Not Running on IntRC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Help! 16F88 Not Running on IntRC'
2007\01\14@003251 by Paul Anderson

face picon face
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
spam_OUTwackyvorlonTakeThisOuTspamgmail.com
http://www.oldschoolhacker.com

2007\01\14@010447 by scott larson

picon face
> 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 <.....wackyvorlonKILLspamspam@spam@gmail.com> wrote:
{Quote hidden}

> -

2007\01\14@022652 by Paul Anderson

face picon face
On 1/14/07, scott larson <.....goldscottKILLspamspam.....gmail.com> wrote:
>
> 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.
>
This is altogether very strange.  I burned your code to the PIC, and
it seemed to be running briefly while still connected to the olimex
programmer(which was still connected to the serial port).  It seemed
to be flashing more quickly than I expected, though.  I carried it
over to my power supply and powered it up.  The LED stays lit, it does
not flash.  To be certain, I swapped the voltage regulator for a
different one.  Same behaviour.  I changed from using my power supply,
to a 9v battery.  Same.  Reconnected to the olimex programmer, same.
The LED stays solidly lit.  Thanks for you assistance.

--
Paul Anderson
VE3HOP
EraseMEwackyvorlonspam_OUTspamTakeThisOuTgmail.com
http://www.oldschoolhacker.com

2007\01\14@024316 by Paul Anderson

face picon face
On 1/14/07, Paul Anderson <wackyvorlonspamspam_OUTgmail.com> wrote:
>  Reconnected to the olimex programmer, same.
> The LED stays solidly lit.  Thanks for you assistance.
>
Hum!  It would seem that the chip wants to have RB6 and RB7 tied to
ground in order to run reliably.  I'm not sure why though.


--
Paul Anderson
VE3HOP
@spam@wackyvorlonKILLspamspamgmail.com
http://www.oldschoolhacker.com

2007\01\14@032004 by scott larson

picon face
This code actually alternatively LEDs blinking on RB0 and RB1.
It should blink a little faster than once per second.

I just programmed a 16F88 and put it on a breadboard with some other
electronics on it. The LED didn't want to light up, so I disconnected
the other electronics and now the 88 works as expected. Try
disconnecting the PIC from the programmer and using a breadboard with
just the PIC, LED and power supply on it.
I don't know why the PIC doesn't work with the other electronics connected....

-Scott


On 1/14/07, Paul Anderson <KILLspamwackyvorlonKILLspamspamgmail.com> wrote:
{Quote hidden}

> -

2007\01\14@033641 by scott larson

picon face
> I don't know why the PIC doesn't work with the other electronics connected....

The other electronics on the board are two 555 timers for another
project I'm working on. Seems all I needed to do was add more
decoupling capacitors to make everything work.

Try adding some more decoupling capacitors. I didn't connect any other
PIC pins to Vss or Vdd, though in practice that's a good idea.

-Scott


On 1/14/07, scott larson <TakeThisOuTgoldscottEraseMEspamspam_OUTgmail.com> wrote:
{Quote hidden}

2007\01\14@061410 by Pearce, AB (Alan)

face picon face
part 1 345 bytes content-type:text/plain; (decoded quoted-printable)

>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.

What are you doing with the LVP pin when attempting to run the chip? Remember this has to be tied one way to program and the other way to run, you cannot leave it floating.


part 2 3088 bytes content-type:application/ms-tnef; (decode)

part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)

2007\01\14@075429 by Wouter van Ooijen

face picon face
> 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.

IIRC the internal clock of this chip defaults to 32kHz.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


2007\01\14@093604 by Gerhard Fiedler

picon face
Wouter van Ooijen 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.
>
> IIRC the internal clock of this chip defaults to 32kHz.

- Fosc: INTRC, with port IO on RA6 and RA7

This selects one of the two internal oscillators. To set the actual
oscillator and frequency, you use OSCCON<4-6>. It defaults to 31.25kHz
<000>. However, running on the lower frequency might make your blinking
very slow, but shouldn't cause it to be erratic.

- MCLRE: Reset tied to Vdd, /MCLR/RA5 is port RA5

This ties the reset input internally to Vdd. May or may not be a good idea,
especially on a breadboard setup where you might "switch it on" by just
plugging in a wire. I don't have experience with this, so I can't tell
whether this works reliably on a breadboard. You could try a simple
resistor/capacitor reset circuit and set this bit to 1.

- LVP: enabled

As Alan said, as long as this is enabled, you need to pull RB3 low for
normal operation. Use a resistor (eg. 10k..100k) to pull it low.

A similar issue is with all the other IO pins. By default, they are all
inputs. If you have nothing connected to them, they are all floating
inputs. Which can cause funny things to happen. I recommend you make all
unconnected pins outputs.

Also, as Scott said, make sure you have the recommended decoupling
capacitors near the PIC.

Gerhard

2007\01\18@030648 by Paul Anderson

face picon face
On 1/14/07, scott larson <RemoveMEgoldscottEraseMEspamEraseMEgmail.com> wrote:
>
> I just programmed a 16F88 and put it on a breadboard with some other
> electronics on it. The LED didn't want to light up, so I disconnected
> the other electronics and now the 88 works as expected.
>
I think it has to do with Timer 1.  I'm not sure.  I added some code
to turn timer 1 off, and programmed the chip using the socket on the
olimex board(no ICSP), and it seems to be working very happily now!  I
have both RB0 and RB1 hooked up.  I am suspicious of a combination of
factors.  I don't think my wiring for the ICSP was as good as it ought
to be, and the chip was getting a touch scrambled during programming.
Secondly, I think that without pulling RB6 and RB7 to ground while
having Timer 1 chattering away, it was making the chip reset or
similar.  I remember reading in the datasheet that the setting for
Timer 1 will override the TRISB port direction settings, and it would
seem that timer 1 can also be configured to provide the internal clock
frequency from an external source.

--
Paul Anderson
VE3HOP
RemoveMEwackyvorlonspam_OUTspamKILLspamgmail.com
http://www.oldschoolhacker.com

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...