srf08+pic16f877+lcd please help me!!!!!

Thread Starter

kin_ahmed

Joined Nov 28, 2011
4
hello >>>>>>>

i don't have an experience with microcontrollers and sensors and lcd's
i'm new in electronics.... so i want to make electronic circuit that measure the distance away from an object using srf08 ultrasonic sensor and pic16f877 and display the result on a (((lcd parallel display)))
i found this code in mikrobasic here it is

http://www.robot-electronics.co.uk/files/srf08PicBasic.pbp

and this is the schematic

http://www.robot-electronics.co.uk/htm/picbasicpro_examples.htm#SRF08 Ultrasonic Ranger

i connected the circuit and burn the hex file of this code to the pic16f877
but i cant display the distance because i don't have (serial lcd)
i have ((parallel))
please help me how to connect the parallel lcd to the pic
knowing that i have (L2012 SII LCD)
and help me if i must edit this CODE>>>
 

ErnieM

Joined Apr 24, 2011
8,045
AFAIK the compiler you are using (PicBasic PRO is referenced in your code link) has support for your LCD. (Example here.)

Typically one would approach such a project with a bit more understanding then just copy code and paste into some unit.
 

Thread Starter

kin_ahmed

Joined Nov 28, 2011
4
i will read your examples and try to study mikro basic and edit my code and if
there is any problems i'll ask you
thank you very much
 

thatoneguy

Joined Feb 19, 2009
6,359
Are you using PICBasic Pro, or MikroBasic?

The two are different in how the LCD is setup and written to.

All the code you've shown is for PIcBasic Pro,but in the last post you stated you are using Mikro Basic.

Which one is it?
 

Thread Starter

kin_ahmed

Joined Nov 28, 2011
4
i am using PIcBasic
pardon me mr.thatoneguy
i read the examples but i didn't understand how to interface my lcd and pic and srf08
i am new in programing please help me guys
 

Thread Starter

kin_ahmed

Joined Nov 28, 2011
4
i'm sorry i can't understand your question well
but i think the ports are 23 and 18 in the pic16f877
which is the serial clock and serial data(SDA and SCL)
and the LCD is connected to port 16 in the schematic that i post and this is what i don't need
because this is a serial LCD so i think i will connect my (D4 D5 D6 D7 on LCD)
to (RA0 RA1 RA2 RA3 in pic16f877)
is that the answer for your question thatoneguy??
 

thatoneguy

Joined Feb 19, 2009
6,359
Look in the manual for your Basic Language, and the function setup for LCD, some require a fixed port set, some do not.

Then there should be an LED Initialize function you call to set up that port, then LCDClear, LCDGoto to get to the part of the screen you want to write, then LCDWrite("what I want to write") or similar, that should all be in help manual.

Important part is to tell the LCDInit that you have the LCD data lines on porta (Make sure you have the TRIS set for output), and what pins enable and reset (if needed) are on. The help will tell you which pins need to be connected, and how to call the function so everything works.
 

whatsthatsmell

Joined Oct 9, 2009
102
Here is the link for the PicBasic Pro Manual :

http://melabs.com/resources/

This is for version 2.60. If you downloaded the trial version of PBP 3.0, the manual is in the software of the download.

PBP makes it simple to control the LCD with just the LCDOUT command. What you put after it controls the cursor and whatever data you send to it. You can use any of the output pins to send data to the LCD, but if you don't use the default pins you just have to define them in your software.

You need the data sheet of the the PIC to set registers properly, so here is the link to that:

http://ww1.microchip.com/downloads/en/DeviceDoc/30292c.pdf

Here is a link to the picbasic forums that is useful to look for similar programs that others have written:

http://www.picbasic.co.uk/forum/forumdisplay.php?f=1

That should give you enough to read for awhile and give you a good start.
 
Top