Re: Microchip PIC programming question




<liamfoxtrot@xxxxxxxxx> wrote in message
news:1120943853.498031.131800@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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

One piece of advice that I still haven't taken to heart seriously. Get
familiar with how the C flag is used during subtraction. It's a bit tricky,
being the reverse of addition. You can easily get your btfsc/s instructions
the wrong way round and it all gets confusing. Good luck.


.



Relevant Pages

  • Microchip PIC programming question
    ... The second chunk I want to do is: ... Based on the calculated Ratio A/B, ... create another PWM that uses fuzzy logic to get the Input E ... but it should all fit on three of them. ...
    (sci.electronics.design)
  • Re: Late night Tuesday/early morning Wednesday smoking
    ... I felt like smoking a cigar, but it's too late to finish the whole ... so I sliced off a chunk to fit in my Pete XL02. ...
    (alt.smokers.pipes)
  • Q: too much data too little memory
    ... Advanced appologies if this turns out to be a trivial question. ... with a large chunk of data that does not fit into all the ... physical memory available to a computer, is it better, to run one process ...
    (comp.unix.programmer)
  • Re: Skip data chunk to next sheet...
    ... > chunks of all this data can fit in one sheet. ... > when the 3rd data chunk comes, ... > Napoleón Cabrera ...
    (microsoft.public.vb.crystal)