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
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