Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 9th May 2008, 02:41 PM   (permalink)
Experienced Member
joshua17ss2 is on a distinguished road
Default LCD Display

I was attempting to connect up my very first lcd last night, i got the connected to the board, and loaded the code, and all the lcd show are 2 lines of solid blocks, i checked the code over and i cant seem to find the problem. I attached the code, is there something in it that im missing,
its coded in swordfish se
The led i have on the board is blinking so i know the processor is doing something.

thanks josh
Attached Files
File Type: txt LCD.txt (1.4 KB, 28 views)
joshua17ss2 is offline   Reply With Quote
Old 9th May 2008, 02:53 PM   (permalink)
Experienced Member
 
futz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to all
Default

Well, I don't know that BASIC or how its libraries work, but two lines of solid blocks says to me that the LCD hasn't been initialized. 44780 LCD's do that when the power is turned on but they haven't been initialized.

Look for an LCD init command of some kind.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is online now   Reply With Quote
Old 9th May 2008, 02:57 PM   (permalink)
Experienced Member
arhi is just really nicearhi is just really nicearhi is just really nice
Default

two lines of solid blocks can also mean that contrast is not setupped properly.
__________________
http://www.it4um.com
arhi is offline   Reply With Quote
Old 9th May 2008, 02:59 PM   (permalink)
Experienced Member
 
futz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to all
Default

Quote:
Originally Posted by arhi
two lines of solid blocks can also mean that contrast is not setupped properly.
That too!
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is online now   Reply With Quote
Old 9th May 2008, 03:03 PM   (permalink)
Experienced Member
joshua17ss2 is on a distinguished road
Default

i adjusted the contrast to that the line went away, im running the contrast pin thougth a 10 k pot as its all i have, this part seems to be working ok.

I was looking at my code agian, could the pic be geing stuck in my first while loop, and just ignoring the rest of the code?

I was loosely following the tutorial for spency's pic basic, the code was basically the same, i adjusted the clock, and option statements to meet my pin out and pic

Last edited by joshua17ss2; 9th May 2008 at 03:05 PM.
joshua17ss2 is offline   Reply With Quote
Old 9th May 2008, 03:28 PM   (permalink)
Experienced Member
arhi is just really nicearhi is just really nicearhi is just really nice
Default

you can compile the code for 16F and run the hex trough http://www.oshonsoft.com/ pic simulator (it simulates the LCD also) ..

as from the source code ..
Code:
...
While True


    LED = 1                         // Turn on the LED


    DelayMS(500)                    // Delay for half a second


    LED = 0                         // Turn off the LED


    DelayMS(500)                    // Delay for half a second


Wend
...
this loop will run forever, you never exit it .. you might use some for loop to do the blink some number of times, or some counter inside the loop then break the loop or goto from it ..

so in short, as your code is written, the DelayMS(150) will never be reached.
__________________
http://www.it4um.com
arhi is offline   Reply With Quote
Old 9th May 2008, 03:46 PM   (permalink)
Experienced Member
joshua17ss2 is on a distinguished road
Default

so if i were to just completely remove the led code it should run thought the lcd code and initialize and display the data
joshua17ss2 is offline   Reply With Quote
Old 9th May 2008, 04:00 PM   (permalink)
Experienced Member
arhi is just really nicearhi is just really nicearhi is just really nice
Default

Quote:
Originally Posted by joshua17ss2
so if i were to just completely remove the led code it should run thought the lcd code and initialize and display the data
It should. Lcd libraries often ask for some LcdInit() before you start using the lcd, but i'm not familiar with compiler you are using, so you will have to try.
__________________
http://www.it4um.com
arhi is offline   Reply With Quote
Old 10th May 2008, 11:40 AM   (permalink)
Experienced Member
 
ericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud of
Default

Quote:
Originally Posted by joshua17ss2
I was attempting to connect up my very first lcd last night, i got the connected to the board, and loaded the code, and all the lcd show are 2 lines of solid blocks, i checked the code over and i cant seem to find the problem. I attached the code, is there something in it that im missing,
its coded in swordfish se
The led i have on the board is blinking so i know the processor is doing something.

thanks josh
hi,
Look at this forum link:

http://www.electro-tech-online.com/m...nds-reset.html
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 10th May 2008, 04:42 PM   (permalink)
Experienced Member
aljamri has a spectacular aura about
Default

Quote:
Originally Posted by joshua17ss2
I was attempting to connect up my very first lcd last night, i got the connected to the board, and loaded the code, and all the lcd show are 2 lines of solid blocks,
Your luck much better than mine. My first LCD did not show even the backligh effect.

software problem is likely to be solved here or there.

Good Luck
__________________
Its what your friend in Your mind, what you in your friends mind
aljamri is offline   Reply With Quote
Old 11th May 2008, 05:45 PM   (permalink)
Experienced Member
joshua17ss2 is on a distinguished road
Default

with some slight tinkering to the wiring and the removal of the led flashing code, i got the data being displayed, just in case i ran out and bought a new pot to adjust my contrast
and everything is working perfectly now.

now i need to figure out how to have the chip multi tasking while displaying my infromation

thanks for the help
joshua17ss2 is offline   Reply With Quote
Old 12th May 2008, 11:09 AM   (permalink)
New Member
Haas is on a distinguished road
Default

try the LCD CS timing
Haas is offline   Reply With Quote
Old 12th May 2008, 12:44 PM   (permalink)
Experienced Member
 
Gordz is on a distinguished road
Default

Real time interupts are good for multi-tasking. Remember that there are certain timing requirements that need to be met when sending commands to the LCD module. There is a huge amount of info on this on the 'net.
Gordz is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Problem with LCD code? spondootre Micro Controllers 15 29th April 2008 09:15 AM
<--noob :) Need help with a Voltmeter/VU Bargraph Lcd display idea Derick2k Electronic Projects Design/Ideas/Reviews 2 5th February 2008 10:39 PM
Substituting a 16x2 LCD display for 16x1 LCD display? Dawny Electronic Projects Design/Ideas/Reviews 13 6th December 2007 01:41 PM
calculator chinmay7 Micro Controllers 1 14th October 2007 12:45 PM
microchip application A590 /display is ok now prosound90 Micro Controllers 20 18th November 2006 09:44 PM



All times are GMT. The time now is 06:15 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.