Re: Microchip PIC programming question



liamfoxtrot@xxxxxxxxx wrote:
Hi,


I am learning how to program a PIC for fun and creating a project for my car. I have downloaded the microchip.com's simulator and am looking forward to trying out some code. So I figure start small and build my way on up. I am not looking for someone to tell me exactly how to do , just a few pointers and links would be greatly appreciated.


I am thinking about getting a PIC16F676 after I know what I am doing a little better.


The first chunk I want to do is:


Input A: 30mv - 75mv Input B: 2.5V - 6.0V Vref: > 6.0V


Calculate: Ratio A/B


Output C: PWM % at A/B*32 (would vary from 16% - 96% at extremes)


The second chunk I want to do is:


Load a 10 point table of min to max ratios and corresponding calibration points from 0-100mv


Based on the calculated Ratio A/B, calculate the corresponding mv using a linear extrapolation between the two closest points on the curve.


Output D: create another PWM at the calculated mv


The third chunk I want to do is:


Input E: sensor reading 0-100mv


Output F: create another PWM that uses fuzzy logic to get the Input E to match Output D. Increasing Output F will increase Input E.


I broke it up into these three pieces since each one had an output that became the input for the next section. I wasn't sure it would all fit on one PIC16F676, but it should all fit on three of them.


Thanks in advance for any suggestions, links, tutorials or the like
that you think will help me with my project.


Thanks
Andy


For a lot of ideas on PIC's - See website below.

--
Luhan Monat: luhanis(at)yahoo(dot)com
http://members.cox.net/berniekm
"Any sufficiently advanced magick is
indistinguishable from technology."
.



Relevant Pages

  • Re: Used Civic or new Fit?
    ... bulletproof engine, little to no maintenance reqired, ... The xA is a nice looking car. ... but the local dealership will be getting the new Fit in soon. ... The Fit Hybrid is at least 2 years away, ...
    (rec.autos.makers.honda)
  • Re: 300C Fuel recommendation
    ... I thought they were trying to fit a new engine into it finally. ... I don't fit in the car comfortably ... Avalon -> Still pursuing. ...
    (rec.autos.makers.chrysler)
  • Re: Used Civic or new Fit?
    ... bulletproof engine, little to no maintenance reqired, ... The xA is a nice looking car. ... but the local dealership will be getting the new Fit in soon. ... The Fit Hybrid is at least 2 years away, ...
    (rec.autos.makers.honda)
  • Re: Used Civic or new Fit?
    ... scion xA or xB. ... bulletproof engine, little to no maintenance reqired, ... The xA is a nice looking car. ... but the local dealership will be getting the new Fit in soon. ...
    (rec.autos.makers.honda)
  • Re: Mazda 5 as surfmobile?
    ... The salesman was more than a little ... is really painful to get everyone out (front door blocks forward exit. ... US but in Quebec, it seems having a mini car is the "in thing", at ... HAAA....wait until I bring my windsurf boards for a test fit next week. ...
    (rec.windsurfing)

Quantcast