Searching \ for ' PIC: 16F84 + Alphanumeric LCD, code loop' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/io/lcd/pic.htm?key=lcd
Search entire site for: '16F84 + Alphanumeric LCD, code loop'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] PIC: 16F84 + Alphanumeric LCD, code loop'
2000\08\03@051411 by Paul Reilly

picon face
Hi,

I've just starting out with the PIC microcontroller and have
setup the simple PIC to alphanumeric display project as
described in the EPE magazine below.

http://www.epemag.wimborne.co.uk/resources.htm
http://www.epemag.wimborne.co.uk/lcd2.pdf

The circuit is set up as described, with...

PORTB <0-7> goes to LCD bus
PORTA 0 goes to the LCD enable pin
PORTA 1 goes to the LCD RW pin
PORTA 2 goes to the LCD RS pin

There's an RC circuit giving 2Mhz connected between OSC1 and MCLR pins.

The program works in that it prints the desired message on the LCD,
bu the problem is it keeps looping! It should just print the message and
stop. But it prints the message, waits about 2 seconds and then prints in
again, gradually filling up all of my 2 x 16 display...

It's not the control loop, as it still loops even if I replace
the message routine with a routine which just prints one letter
and then stops. Like this:

message  movf  counter,0
        movlw  'B'
        bsf PORTA, RS
        bcf PORTA, RW
        movwf PORTB
        call  pulse_e
        call  short_delay
stop     goto  stop

The above prints a 'B' on the LCD and then gradually fills up
the 2 lines of the display with 'B's!!

I thought it might be an interrupt occuring and starting to
execute my code at 0004 and basically running the program
repeatedly. But I inserted a disable GIE instructions and setup
a loop at 0004 like  so:

org 0x0000
goto              initialise

org 0x0004
isr               goto isr

initialise        bcf INTCON,GIE
                   ...more code....


Has anyone experienced this or can anyone shed any light
on why the program might be looping?

Confused...

Paul

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\03@052910 by ruben

flavicon
face
> ....
> Has anyone experienced this or can anyone shed any light
> on why the program might be looping?
>
> Confused...
>
> Paul
>
> --
> http://www.piclist.com hint: The list server can filter out subtopics
> (like ads or off topics) for you. See http://www.piclist.com/#topics


Is the watch dog timer enabled?

Put a CLRWDT in your stop loop.

stop  clrwdt
     goto stop

If this helps, you have to disable the watch dog timer.
==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
spam_OUTrubenTakeThisOuTspampp.sbbs.se
==============================

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\03@083053 by Scott Dattalo

face
flavicon
face
On Thu, 3 Aug 2000, Paul Reilly wrote:

> Hi,
>
> I've just starting out with the PIC microcontroller and have
> setup the simple PIC to alphanumeric display project as
> described in the EPE magazine below.
<snip>

> Has anyone experienced this or can anyone shed any light
> on why the program might be looping?

Just think, you could've answered this question in seconds had you had gpsim and
the LCD module :). Oh - did I say LCD module? Oops, that won't be ready until
next week. Meanwhile, the PICLIST is the next best thing to a simulator.

Scott

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

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