Searching \ for '[PIC] Strange behaviour of blinking led' 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/displays.htm?key=led
Search entire site for: 'Strange behaviour of blinking led'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Strange behaviour of blinking led'
2006\05\23@110217 by Goran Hosinsky

picon face
I am learning and experimenting with a 12F629 doing a simple
loop:

blink
        bsf     GPIO, 0
        call    delay
        ; X
        bcf     GPIO, 0
        call    delay
        goto    blink

The delay is about 250 mS, code from /techref/piclist/codegen/delay.htm
It works as expected. But if I add a second "call delay" at "X" I
expect to get double length pulses with single length space in between.
What I get, though, is

on single length space, one double length pulse one single length space
TWO double length pulses with a dip of about 20mS in the middle, and so
on.
  __   __ __   __   __ __
_|  |_|  |  |_|  |_|  |  |_

I do not understand this, could somebody please explain?
The complete code is at http://www.hierbabuena.info/blink.asm

Goran


2006\05\23@113210 by Stef Mientki

flavicon
face
Watchdog perhaps ?
Stef

Goran Hosinsky wrote:
{Quote hidden}

2006\05\23@114931 by Timothy Weber

face picon face
Goran Hosinsky wrote:
> What I get, though, is
>
> on single length space, one double length pulse one single length space
> TWO double length pulses with a dip of about 20mS in the middle, and so
> on.

Is the watchdog timer turned off?
--
Timothy J. Weber
http://timothyweber.org

2006\05\23@115837 by Mark Scoville

flavicon
face
> It works as expected. But if I add a second "call delay" at "X" I
> expect to get double length pulses with single length space in between.
> What I get, though, is
>
> on single length space, one double length pulse one single length space
> TWO double length pulses with a dip of about 20mS in the middle, and so
> on.
>    __   __ __   __   __ __
> _|  |_|  |  |_|  |_|  |  |_
>

The watchdog timer could be causing undesired resets? Disable the watchdog
if it is not already disabled and see what happens.

-- Mark



2006\05\23@144821 by Goran Hosinsky

picon face
The watchdog timer was the problem, seems it is on by default and I
had not specified it in the config statement.

My config now looks like

 __config _INTRC_OSC_NOCLKOUT & _PWRTE_ON & _BODEN_ON  & _WDT_OFF

What more switches have I missed?
Goran

Mark Scoville wrote:
{Quote hidden}

2006\05\23@151819 by Spehro Pefhany

picon face
At 07:48 PM 5/23/2006 +0100, you wrote:
>The watchdog timer was the problem, seems it is on by default and I
>had not specified it in the config statement.
>
>My config now looks like
>
>   __config _INTRC_OSC_NOCLKOUT & _PWRTE_ON & _BODEN_ON  & _WDT_OFF
>
>What more switches have I missed?
>Goran

Look at the data sheet for "Configuration Bits" (at the include file too
for the names). There are a few more to consider. ;-)

BTW, you should be setting up CMCON as well, to disable the comparator,
although it doesn't happen to make much difference in this case.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
->>Test equipment, parts OLED displys http://search.ebay.com/_W0QQsassZspeff


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