Log in

View Full Version : urgent help


engkhlaif
14-12-2007, 16:01
dear all,
i have and gp2d12 ir sensor in my project
i need a help in writing a code that operate this sensor
the idia is to interface the GP2D12 sensor with PIC16F877A and the sensor will detect the object (moving on a line) and then display the distance on an LCD 16*2
note:
this sensor gives analog output and then we need to convert it to digital through PIC A/D pins
plz any one can give me help as i need it as soon as he can
thanx

dtengineering
14-12-2007, 17:23
What language are you programming in?

What is the interface to your LCD display? (is it an RS-232 serial connection or something else?)

You may find that PIC Basic Pro (http://www.melabs.com/products/pbp.htm) has all the functions that you need. Read the manual and download the demo version from the page I have linked to and you could have your problem solved pretty quickly.

Jason

engkhlaif
15-12-2007, 10:50
What language are you programming in?

What is the interface to your LCD display? (is it an RS-232 serial connection or something else?)

You may find that PIC Basic Pro (http://www.melabs.com/products/pbp.htm) has all the functions that you need. Read the manual and download the demo version from the page I have linked to and you could have your problem solved pretty quickly.

Jason
thanx for care
the language that i need is c language and it will be compiled on pic c compiler and the used pic is pic16f877a
about the LCD it will be interfaced surly with the pic also
thanx again Jason

Ken Leedle
15-12-2007, 12:26
Do you have access to a PIC programmer? Are you doing this on a dev board or a circuit that you designed? What type of LCD are you using? Is it a parallel or serial (SPI, UART, I2C, etc) interface? This (http://home.iae.nl/users/pouweha/lcd/lcd.shtml) is a description of a fairly common parallel LCD interface. It also has a PIC assembly example.
-Ken

engkhlaif
15-12-2007, 14:09
Do you have access to a PIC programmer? Are you doing this on a dev board or a circuit that you designed? What type of LCD are you using? Is it a parallel or serial (SPI, UART, I2C, etc) interface? This (http://home.iae.nl/users/pouweha/lcd/lcd.shtml) is a description of a fairly common parallel LCD interface. It also has a PIC assembly example.
-Ken

dear
i have pic16f877a and i need sample code written in c language to operate this type of sensors
about the lcd it is 16*2 and it is usual lcd
any way any one can help me iam glad to him

3dude_2231
15-12-2007, 15:26
Hi Jason,
first of all, are you a member of a FIRST team, or just got here by chance? =]

now..
*read your datasheet to this sensor, check to see what king of output does it give.
*read PIC's datasheet as well, to see what do you need in order to operate
the PIC's ADC, it shouldn't be hard, but educational.
-if you are pressed with time, I could assist you, but studying the PIC's
architecture would be of much greater value to you.

do you have any former experience with PICs?

Ran.

engkhlaif
16-12-2007, 02:38
Hi Jason,
first of all, are you a member of a FIRST team, or just got here by chance? =]

now..
*read your datasheet to this sensor, check to see what king of output does it give.
*read PIC's datasheet as well, to see what do you need in order to operate
the PIC's ADC, it shouldn't be hard, but educational.
-if you are pressed with time, I could assist you, but studying the PIC's
architecture would be of much greater value to you.

do you have any former experience with PICs?

Ran.
first of all
Ran iam engkhlaif who need the help
any way
about me i dont know what is FIRST but iam a student in my last year and ,ofcourse i had experience witth PIC's
i have read the sensor datasheet the type of my sensor if GP2D12 wich gives analog output so i need to configure them (ADC's pins)
i need sample code that will read the sensor output then convert it to digital and then display the distance on LCD
the programm iam using is MPlab v7.31
please any one can help
thanx to all