Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help with the pic 18 f 8722

Status
Not open for further replies.

mnfsoft

Newbie level 6
Joined
May 19, 2010
Messages
13
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
Iraq
Activity points
1,359
Dear Friend,

I have a pic18f8722 line follower project and I am facing a problem with writing the code in micro c
because I need to read the inputs as analogue
Thee front color sensors and three back


how can I do this in Micro C
 

Forget the programming language for now - if the sensors are analogue then what do the signals mean? How do they alter with respect to the 'line' you are following?
What algorithm (not code) are you going to use to interpret their values? What outputs do you need (presumably to drive some motors)? How fast does the whole system need to react and therefore how fast do you need to sample the sensors?
Once you have the basic design sorted, then you can look at the limitations of the device you have selected. Does it have enough ADC inputs? Can it directly drive the outputs and how (coded values, PWM...)?
Once you have all of that designed, then you can start to think about the program. Again, forget about the programming language still as you need to determine if the program should be polling the inputs or using interrupts? How are you converting the algorithm to some sort of flow diagram - state driven or what?
Only then should you start looking at the code. Break the design down into the various input and output controls and how these will be managed within the main loop of the program. If you have done the ground-work properly, then the design of the code should flow form that.
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top