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.

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Status
Not open for further replies.
hi C,
Vid2 is my lazy way of saying watch the uTube video number 2, following video #1, that you posted.:)

The lcd should show alternate On/Off pixels as per video #2... I am stepping thru video 2 in order to confirm success at each step.
Hi E,
Played with a few changes in the LOOP, but got odd results. i,e 0x00 produces lines all the way down the screen.

I'm now following this program, by Chris Holden as a guide.
C.
 

Attachments

  • 5110 BASIC program edited.txt
    18.8 KB · Views: 291
hi C,
I am sorry to keep dripping like at tap...:(, but I do really want to help.
The Holden program is written to suit a bigger PIC than the 18LF2520, it will require extensive changes to make it work.
It is not using SPI commands, but Bit commands.

May I ask why, after fixing the PIC, SPI to 5110 are you changing to a totally different method.?

E
 
hi C,
I am sorry to keep dripping like at tap...:(, but I do really want to help.
The Holden program is written to suit a bigger PIC than the 18LF2520, it will require extensive changes to make it work.
It is not using SPI commands, but Bit commands.

May I ask why, after fixing the PIC, SPI to 5110 are you changing to a totally different method.?

E
Hi E,
I'm not changing from SPI, only using it as a guide, as I understand that the 5110 needs libraries for the text.
CORRECTION: In #101 I said 0x00 produces lines. I should have said 0x00 pixels all off, 0xff pixels all on and 0x01 lines all down the screen.
C.
 
hi C,
This bit of code sets the LCD write direction [left to right across the screen]
BTW: the text code ASCII table in the Holden file is the same as the Video, but Holden starts at 'A' not like the Video, which is: Space followed by the maths symbols, then the ASCII chars.

I should have said 0x00 pixels all off, 0xff pixels all on and 0x01 lines all down the screen

Which is correct.

E
lcdxy:
SPICSOn
SPISend 0x80
WaitUs 100
SPISend 0x40
SPICSOff
WaitMs 1
Return
 
hi C,
This bit of code sets the LCD write direction [left to right across the screen]
BTW: the text code ASCII table in the Holden file is the same as the Video, but Holden starts at 'A' not like the Video, which is: Space followed by the maths symbols, then the ASCII chars.

I should have said 0x00 pixels all off, 0xff pixels all on and 0x01 lines all down the screen

Which is correct.

E
lcdxy:
SPICSOn
SPISend 0x80
WaitUs 100
SPISend 0x40
SPICSOff
WaitMs 1
Return
Hi E,
You're much quicker than I am, I will have to play and read a bit longer for me to figure out what's going on.
C.
 
hi,
While I have been waiting I did this..
Should display 55/aa pattern repeated [vid2]
E
Hi
I tried playing this morning, but the module stopped working so I went back to #96 and this didn't work till I added:
SPICSOn
SPISend 0x55
SPICSOff
WaitUs 1
SPICSOn
SPISend 0xaa
SPICSOff
C.
 
hi C,
Not a problem, I am working out a LCD Font that we can use with Oshonsoft Basic.
It looks OK in simulation, let me know when you would like to try writing text to the lcd.
E

EDIT
: this should work OK.
SPICSOn
SPISend 0x55
SPISend 0xaa
SPICSOff

EDIT2:
Your posted 5110 has just arrived in good condition. :woot:
 
Last edited:
hi C,
Not a problem, I am working out a LCD Font that we can use with Oshonsoft Basic.
It looks OK in simulation, let me know when you would like to try writing text to the lcd.
E
Morning E,
I'm happy to try any time, at the moment, I'm trying to understand how it works.
Hopefully, next I will add a barometer module also SPI, as an altimeter, so hopefully the 5110 will give the results.
C.
 
hi C,
Got the 5110 lcd working OK with a 18F4520, displaying ASCII characters.
At the moment I have only have the 'A thru G' ASCII fonts in the font table, it just a chore adding the remainder of the alphanumeric set.
I need to tweak the Contrast setting later.
E
 
hi C,
Got the 5110 lcd working OK with a 18F4520, displaying ASCII characters.
At the moment I have only have the 'A thru G' ASCII fonts in the font table, it just a chore adding the remainder of the alphanumeric set.
I need to tweak the Contrast setting later.
E
Hi E,
If you post the program, I can add the remaining digits etc
C.
 
hi,
I will post the program later, managed to improve the Contrast.
Got a decent picture of the displaying LCD, but for some reason I cannot transfer files to my PC, very annoying.
It displays '0123ABCDEFG' top left line.
E

EDIT:
Is was the USB cable adaptor
5110Font1.jpg
 
Last edited:
hi C,
This is the latest version of the program , I have added some comments to help you follow the code.
I would suggest you try adding to and modifying this diagnostic program and use the modified program for the work we will do together.
Once you are satisfied, try it within your main project program
E
 

Attachments

  • Cam5110_SPIa.bas
    4.4 KB · Views: 289
hi C,
This is the latest version of the program , I have added some comments to help you follow the code.
I would suggest you try adding to and modifying this diagnostic program and use the modified program for the work we will do together.
Once you are satisfied, try it within your main project program
E
Hi E,
It looks really neat. I'll have a better look tomorrow.
Thanks,
C.
 
Hi E,
Here's the amended program:
I hope I've done it correctly.
C
 

Attachments

  • 18f4520 8MHz INT 5110 DIGITS 131017 1200.txt
    7.5 KB · Views: 312
Hi
I tried playing this morning, but the module stopped working so I went back to #96 and this didn't work till I added:
SPICSOn
SPISend 0x55
SPICSOff
WaitUs 1
SPICSOn
SPISend 0xaa
SPICSOff
C.
EDIT:Not sure the SPICSOff is the problem, as I am still getting intermittent working??
 
hi C,
I have been writing to the lcd with that basic program most of the day with no problems at all.
Adding lcd line selection, line start position etc, all working fine.
Next step is to use an analog port and display ADC data.

You seem to have a intermittent fault on your hardware.
E
Give it a try, displays 0 to 9 and DP on all 6 lines of the lcd.
 

Attachments

  • Cam5110_SPIb.bas
    5.8 KB · Views: 305
One thing I noticed: strings start at position 1, not 0.
hi jjw,
So did I, will try to figure out why tomorrow.
E
Do you also see those two left side pixels at 0x80 and 0x40.??
I figure the DC level needs checking [later]

main:
'data write to LCD block, specify required positions of X and Y

Gosub lcdxy 'set lcd write at top left of screen

wr2lcd:
'write some data pattern
 
Last edited:
lcdxy should be executed in command mode.
Now it displays the dots 0x80, 0x40
Add lcd_data_command=0 to lcdxy
 
Last edited:
lcdxy should be executed in command mode.
Now it displays the dots 0x80, 0x40
Add lcd_data_command=0 to lcdxy

Thanks, but I have already done that,ref post #118.;)
E

jjw
camerart
EDIT:
NOTE: Oshonsoft MidStr will read the double quote at the start of the string, if the pointer starts at 0 [zero].
The LEN will return the length of the string not counting the quotes.

This was the reason I was getting a space at the start of my displayed lcd string.

Example:
menu1 = "0123456789ABCD"


'gets each ASCII char in turn and writes it to lcd
msg2lcd:
Gosub lcdxy
lcd_data_command = 1 'data
y = Len(msg1)
For x = 1 To y ' using a for 0 to y, will get the double quotes and the full string.
ascval = MidStr(msg1, x, 1)
Gosub chr2lcd
Next x
Return
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top