LCD won't display?

Status
Not open for further replies.

MrDEB

Well-Known Member
Have checked and rechecked all my connections but still no "HELLO WORLD"
What am I missing? Sorry if I posted code wrong?
ANY SUGGESTIONS for this simple task?

 

Attachments

  • PID sch.png
    36.8 KB · Views: 141
You can't put LCD.WriteAt(2,1,Convert.DecToStr(Variable,5)) It's LCD.WriteAt(2,1,DecToStr(Variable))

Code:
Device = 18F1320
Clock = 8 // 8MHz clock
Config OSC = INTIO2

// some LCD options...
#option LCD_DATA = PORTB.0 // Assign the LCD connections
#option LCD_EN = PORTB.5 //
#option LCD_RS = PORTB.4 //

// import LCD library...
Include "IntOSC8.bas"
Include "utils.bas"    // Your need this 
Include "LCD.bas"
Include "convert.bas"
Dim Variable As Word
SetAllDigital         //????? set's pins to output
// Start Of Program...
DelayMS(150) // Let the LCD warm up
LCD.Cls // Clear the LCD screen
LCD.WriteAt(1,1,"Hello World")
// Send some text to the LCD
Variable = 0 // Clear the "Variable" register
While True
Inc(Variable) // Increment the "Var1" register
// Convert to a string,
// and always display 5 characters
LCD.WriteAt(2,1,DecToStr(Variable))

DelayMS(1000) // Delay for 1 second
Wend

You forgot to Include "utils.bas" // Your need this to set Digital with SetAllDigital //????? set's pins to output
 
Last edited by a moderator:
I used a sample code that I think I had working before but different chip?
Why do some have no INCLUDES and other code doing the same thing have several INCLUDES.?
will try the new code out.
Need to figure out where to put (write) different headings for a PID controller. Going one step at a time. Have found several PID controllers that were bought but failed to work as planned.
 
NO WORKIE?
Going to recheck wiring, perhaps the 330 resistor needs to be smaller/ larger?
change out the PIC
Tried adjusting the pot but to no avail?
will get back to you.
perhaps a basic LCD program to just debug and be failsafe---lol
 
Well the reason is simple some code is not using all the library's and some is.

Include "utils.bas" is needed if you don't want to set pin as I/O if you set them your self it's not needed and some times with some chips it doesn't work

so most time I don't use it.

Make you template like this one
Code:
Device = 18F1320   //Change to match Chip your using 
Clock = 8 // 8MHz clock   set to what Mhz your using
Config OSC = INTIO2  //Set for OSC or FOSC 
 
//   #options here

 
// Include here
Include "IntOSC8.bas"   // Just comment out whats not needed 
Include "utils.bas"    // Your need this 
Include "LCD.bas"
Include "convert.bas"

////Dims here



/// Port setup here 



//// Main code here
 
do you have mclr pulled up to vdd with a resistor ? I no the code works I even posted a video showing you what it looked like
 
The grd and Vcc on pin 3 of the LCD was not connected (I started on this board about 8-10 months ago and just now getting back to it)
I connected missing connections, adjusted the contrast and BAM I have text!!
THANKS
Now to see what all the numbers in the LCD statement stand for. I know they move the text around to duifferent lines.
Using a 4 line LCD
 
Good to see it working we would never have done it with out tom and jerry LOL just a joke
 
You mean Frick and Frack?? LOL
Now on to inputting the temp program.
Going to continue with designing a PID.
Been contemplating the code as I posted eleswhere and was critized that it won't work. Wasn't actual code but an idea of how the code will flow.
Need to implement how to increment DESIRED TEMP. Using two pushbuttons (1's and 10's) plus up/down. Looking over the Geek Clock code as example.
will post a first version of schematic when done converting to DIPTRACE.
 
MrDeb if you keep it 140 to 141 I bet the steak will taste the same LOL. A dang On at 140 off at 141 would be close enough

And I would seared the meat at high temp before trying this.
 
Now to display temps

Using the DS18B20 .bas code and the LCD code from yesterday.
Almost got it but won't compile due to syntax error when using the LCD instead of the usart.
 
Checking if probe is working

Using the following code, I got the usart to display in C only along w/ ROM ID #
BUT the temp is wrong?
probe in ice water bath and reads 10c not 0c
been fiddeling w/ conversion (*128, was 256)
This is using the Junebug only (have the LCD connected to another board instead for later but figure I would verify that the probe actually works.
Tried several code versions but this is the only one that works?
After getting this sorted out, on to getting it to display on LCD
This code was done by Pommie



 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…