PDA

View Full Version : Tip: For Non working gLCD on EasyPic5 Board



manwolf
- 21st June 2008, 23:43
After banging my head on the wall (mister_e already has the keyboard) I finally got it working.
There are at least 5 different example folders on the CD all claiming to be for the EasyPic5 with a PIC16F887. I have tried them all and because I am using PBP I never installed MicroBasic. Today I decided to install it and lo and behold another EasyPic5 folder in the examples folder.

I looked at all of the code and found the only difference was that this new one had two added lines.


ANSEL = 0
ANSELH = 0

I guess before this release they found the code was missing and added it in.

At least now I can get on with my project.

Many thanks to everyone who responded to my posts, nice to know there are so many wanting/willing to help. Also is nice to know I wasn't total out of my mind. :p

The correct example HEX has a date modified of 4/7/2008

Acetronics2
- 22nd June 2008, 16:18
Hi, Manwolf

You really need a new pair of glasses ...



' Dev.Board: EasyPIC5
' Oscillator: HS, 8.000 MHz
' Ext. Modules: None
' SW: mikroBasic v7.0
' * NOTES:
' - to turn ON Glcd backlight switch "GLCD" on SW9 (board specific)
' *

program Glcd_Test

include __Lib_images

dim
ii as byte
jj as word
someText as string[25]

sub procedure delay2S
delay_ms(2000) ' 2 second delay sub procedure
end sub


main:
[b] ANSEL = 0 ' Configure AN pins as digital I/O
ANSELH = 0[b]

Glcd_Init(PORTB, 0, 1, 2, 3, 5, 4, PORTD) ' Glcd_Init_EP5, see Autocomplete
Glcd_Fill(0xAA)
delay2S

....

manwolf
- 22nd June 2008, 18:07
You calling me a BLIND old man now? Darn thought I was safe hiding here on this Internet thingy. HaHa



' Dev.Board: EasyPIC5
' Oscillator: HS, 8.000 MHz
' Ext. Modules: None
' SW: mikroBasic v5.0 or higher
' * NOTES:
' None
' *)
program GlcdTest

include "__Lib_images"

dim
ii as byte
jj as word
someText as string[20]

sub procedure delay2S
delay_ms(2000)
end sub

main:
Glcd_Init(PORTB, 0, 1, 2, 3, 5, 4, PORTD) ' Init for EasyPIC5 board
Glcd_Fill(0xAA)
delay2S
while TRUE
Glcd_Fill(0x00)
Glcd_Image( truck_bmp )
delay2S

Glcd_Fill(0x00)


Notice the SW version v5.0 and up in mine and yours has 7.0.

My example came straight off the CD that came with the board.

And yes I <b>really</b> do need new glasses, I have an appointment Wednesday. LOL

What really makes me upset is the fact you had just pointed out that issue with my code for the LCD.

But to be fair I wrote the code for the LCD myself and I <b>assumed</b> that MikroBasic added the Port setup for you in the example.

I lost the manual when I was born and can't find the brightness knob!