Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 21st November 2007, 07:03 PM   (permalink)
Default Urgent!!!! Pic16f877 Adc

hi there

i have build a line follower robot using the above mentioned pic...i am now in the process of trying to program it.....i have used 3 phototransistors as sensors that are connected to AN0, AN1 and AN3 of the pic.....how do i actually go about programming it so that i should keep reading the outpts of these sensors all the time? please help me....i need the code in C.

thanks a lot....
preeste is offline  
Old 21st November 2007, 07:32 PM   (permalink)
Default

You need to:-

Set the analog input to AN0
wait the sampling time
Start the conversion
wait for the conversion to finish
read the value of AN0

etc for AN1 and for AN2

repeat

There is only one ADC converter, but it is very quick so the whole lot takes very little time.

I only have code in assembly language.
Diver300 is offline  
Old 21st November 2007, 07:45 PM   (permalink)
Default

Urgent usually means school assignment.

PS line followers usually use comparators not A/D.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Old 23rd November 2007, 06:50 PM   (permalink)
Default

lol...it is actually not a project...just a little thing i decided to do but in like 2 days i go back to school and wont hae anytime for my line follower....so thought i would finish as soon as possible....i am using the pic16f877 and it just makes sense to use the adc....thanks diver300...that was helpfuk
preeste is offline  
Old 23rd November 2007, 08:44 PM   (permalink)
Default

In that case this site is helpful for budding robot builders.
http://www.robotroom.com/
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
urgent!! interfacing the pic16f877 to the pc serial port foosm Micro Controllers 15 15th May 2008 02:44 PM
Problem with multiple ADC using pic16f877 andyto Micro Controllers 15 24th September 2007 11:48 PM
16F877 Timer0 Interrupt Affecting ADC sebana Micro Controllers 13 12th September 2007 10:43 AM
PIC16F877 ADC problems, urgent help needed grutt Micro Controllers 6 1st April 2004 04:07 PM
urgent help needed for pic16f877 programming bythesea Micro Controllers 5 10th January 2004 07:53 PM



All times are GMT. The time now is 01:43 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker