Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2016, 09:37:05 21:37


Login with username, password and session length


Pages: [1]
Print
Author Topic: Problem with standard LCD CCS library  (Read 1229 times)
0 Members and 1 Guest are viewing this topic.
cerebronico
Junior Member
**
Offline Offline

Posts: 75

Thank You
-Given: 165
-Receive: 27



« on: August 21, 2012, 08:32:07 20:32 »

Hi folks,

I have a couple of days trying to figure out what the problem will be, bellow is the link to proteus simulation and source code in PICC from ccs v130 for a PIC16F876A

Simulation work well but the actual circuit don't, the microcontroller goes into an enless loop at lcd_init(), any help will be greatly appreciated

regards,


c
Logged
darck_khronos
Junior Member
**
Offline Offline

Posts: 59

Thank You
-Given: 4
-Receive: 93

Khronoscorp Systems


WWW
« Reply #1 on: August 21, 2012, 09:25:27 21:25 »

use this.
Logged
Magnox
V.I.P
Active Member
*****
Offline Offline

Posts: 208

Thank You
-Given: 775
-Receive: 238


Oink!


« Reply #2 on: August 21, 2012, 10:14:41 22:14 »

If lcd_init() is not exiting, it's probably due to the read function (called by the write function - look in the lcd header) which checks for the LCD-BUSY flag (LCD pin data bit 7 iirc). The read function is called to make sure that the LCD has finished processing the previous command andis ready for the next character or command. If you haven't connected it properly so that the LCD-BUSY flag is never seen to go low, then the read function will be called endlessly.

Personally I don't use that method, instead just making sure enough time has passed after a write based on the LCD's datahseet. I modified CCS's code to accomplish that.
Logged
oxygen007m
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 215
-Receive: 66


« Reply #3 on: August 21, 2012, 10:39:23 22:39 »

If you are using external crystal higher than 4 MHz , make sure the two parallel capacitors is 22pF and use HS in fuse option and also connect the clear pin to VCC .
Logged
cerebronico
Junior Member
**
Offline Offline

Posts: 75

Thank You
-Given: 165
-Receive: 27



« Reply #4 on: August 21, 2012, 11:04:59 23:04 »

If lcd_init() is not exiting, it's probably due to the read function (called by the write function - look in the lcd header) which checks for the LCD-BUSY flag (LCD pin data bit 7 iirc). The read function is called to make sure that the LCD has finished processing the previous command andis ready for the next character or command. If you haven't connected it properly so that the LCD-BUSY flag is never seen to go low, then the read function will be called endlessly.

Personally I don't use that method, instead just making sure enough time has passed after a write based on the LCD's datahseet. I modified CCS's code to accomplish that.

Yes, this is exactly what I'm getting as I step thru debugging: the CCS default routine keeps reading bit 7, I'm gonna try darck_khronos snippet and post the results

thx

c
Logged
cerebronico
Junior Member
**
Offline Offline

Posts: 75

Thank You
-Given: 165
-Receive: 27



« Reply #5 on: August 22, 2012, 01:56:40 01:56 »

Ok, this is an update, code from darck_khronos works, I has to change control pins from port a to port b and now it works, so maybe the port a configuration didn't allow it to be used, anyway problem solved

Thanks you all guys

c
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC