Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

can anyone help me??

Status
Not open for further replies.

belinda_sg

New Member
i am a newbie in PIC programming, even in assembly....

i am asked to use PIC18F2320 to do the following things:
i am given a lookup table like this

Input Voltage(x) Output Data(y)
2.75 7.1
2.80 7.2
2.85 7.3
2.90 7.4

as you can see, the relationship between y and x is y=2x+1.6.

i think i should do the follwoing things: first store the output data into EPROM, and form a lookup table, convert the input voltage into digital through ADC, and then relate these two through READ EPROM value...

but i am not sure of all of these things are correct or not...

can anyone help me in this?
and if possible, give me a short solution for that?
i have searched a lot websites, but hard for me to get a complete code example?
and the only ref i can get is the MIC's datasheet for the MCU, but there is no complete codes example...

really thanks for your help...
 

Nigel Goodwin

Super Moderator
Most Helpful Member
It could easily be done mathematically, the formula is very simple, and easily scalable to get rid of decimal points.

You've already made a lot of posts about this, but you only mention a small piece of the problem each time. It would be a lot better if you posted your exact requirements.

You've also suggested you only need 4 bit resolution from the A2D, that would make it very simple to use a small lookup table (or jump table) to convert from the A2D to what you want.

I presume you mean EEPROM, when you mentioned EPROM?, there's no need to do that, the lookup (or jump) table is simply stored in program memory.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top