Continue to Site

# LCD Problem

Status
Not open for further replies.

#### birdman0_o

##### Active Member
Hey guys, what in this code do you think would make my LCD reset "frequently"

Code:
	Call	LCD_Line1
MOVLW	'T'
Call	LCD_Char
MOVLW	'e'
Call	LCD_Char
MOVLW	'm'
Call	LCD_Char
MOVLW	'p'
Call	LCD_Char
MOVLW	'e'
Call	LCD_Char
MOVLW	'r'
Call	LCD_Char
MOVLW	'a'
Call	LCD_Char
MOVLW	't'
Call	LCD_Char
MOVLW	'u'
Call	LCD_Char
MOVLW	'r'
Call	LCD_Char
MOVLW	'e'
Call	LCD_Char
MOVLW	':'
Call	LCD_Char

CALL	LCD_Line2
MOVLW	' '
Call	LCD_Char
MOVF	Thou,W						;
Call	LCD_CharD
MOVF	Hund,W						;
Call	LCD_CharD
MOVLW	'.'
Call	LCD_Char
MOVF	Tens,W						;
Call	LCD_CharD
MOVLW	' '
Call	LCD_Char
MOVLW	b'11011111'
Call	LCD_Char
MOVLW	'C'
Call	LCD_Char

Call	Delay255
Call	Delay255
Call	Delay255
Call	Delay255
Call	Delay255
Call	Delay255

GOTO 	Main

PIC16F88...

Here is a video:

Let me know if you need to see more of the code

Last edited:

#### Oznog

##### Active Member
Are you using the WDT?

#### birdman0_o

##### Active Member
Nope, I have a feeling I might need to post my whole code >.>

Code:
	List	P=16F88
#include	"P16F88.INC"
__CONFIG	_CONFIG1,   _PWRTE_ON  & _WDT_OFF & _INTRC_IO & _BODEN_OFF & _LVP_OFF & _CP_OFF & _MCLR_OFF
__CONFIG    _CONFIG2,	_IESO_OFF & _FCMEN_OFF

Last edited:

#### Mr RB

##### Well-Known Member
Its probably the table read trying to read an illegal value, ie too high, so it jumps out of code and continues to the end where it loops back to 0x000 and gives the impression of a reset.

In your LCD_Char function, put a correct for illegal char so if w contains a char that is too high the table read is constrained to the last table entry or better still displays an error character on the LCD.

#### birdman0_o

##### Active Member
I dont actually have a table though. The orginal code I posted is part of my main loop. It's a brute force attack which I will fix tonight. So that it does not reprint the "Temperature:" so much...

#### birdman0_o

##### Active Member
I put a 100nF capacitor accross the pic and it is now happy!
Wonder why...first time i've had this problem.

#### Mr RB

##### Well-Known Member
Nasty power glitches... Are you driving a relay or something?

#### birdman0_o

##### Active Member
Nope and its weird, because I have other things attached too and they work. Furthermore I have a big fat cap accross the power rails.

Status
Not open for further replies.

Replies
18
Views
2K
Replies
17
Views
2K
Replies
12
Views
1K
Replies
25
Views
2K
Replies
14
Views
1K