Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 11:32:44 11:32


Login with username, password and session length


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

Posts: 76

Thank You
-Given: 262
-Receive: 27



« on: August 21, 2012, 07:32:07 19: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: 55

Thank You
-Given: 5
-Receive: 93

Khronoscorp Systems


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

use this.
Logged
Magnox
Active Member
***
Offline Offline

Posts: 249

Thank You
-Given: 976
-Receive: 279


Oink!


« Reply #2 on: August 21, 2012, 09:14:41 21: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
Newbie
*
Offline Offline

Posts: 33

Thank You
-Given: 376
-Receive: 71


« Reply #3 on: August 21, 2012, 09:39:23 21: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: 76

Thank You
-Given: 262
-Receive: 27



« Reply #4 on: August 21, 2012, 10:04:59 22: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: 76

Thank You
-Given: 262
-Receive: 27



« Reply #5 on: August 22, 2012, 12:56:40 00: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