Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LCD Display

Status
Not open for further replies.

joshua17ss2

New Member
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
 

Attachments

  • LCD.txt
    1.4 KB · Views: 164
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.
 
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:
you can compile the code for 16F and run the hex trough https://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.
 
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 said:
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:

https://www.electro-tech-online.com/threads/why-does-my-18f1320-take-33seconds-to-reset.39155/
 
joshua17ss2 said:
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 ;)
 
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
 
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top