electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

how to convert 8bit binary to milivolt..in PIC16F84


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> how to convert 8bit binary to milivolt..in PIC16F84
Author Message
theenes



Joined: 15 Sep 2005
Posts: 21


Post17 Mar 2006 6:47   

pic16f84 multiply


if i use external a/d converter TLC549,8 bit converter integrate with pic16f84..once i scan the 8 bit dataout into a variable register..then how could i convert this 8bit binary data into milivolt value..can anybody help me on this coding,using assembly language..
thanking u in full of anticipation..

theenes
Back to top
Buriedcode



Joined: 06 May 2004
Posts: 327
Helped: 34
Location: London


Post17 Mar 2006 19:51   

Re: how to convert 8bit binary to milivolt..in PIC16F84


Hi,

If I understand what you are trying to do correctly, then you are sampling a voltage, and you wish to have the number in milivolts? correct?

Well, I guess it depends on the input voltage range. -5v to +5v? 0-2v? That ADC has two reference inputs, for - and + setting that range of the sampled voltage. It may seem easy to simply 'multiply by 1000' (V -> mV) but thats only if the input range is 1v. To find out what the smallest increment of voltage you can measure (LSB) simply divide your input range by 256, for 8-bit resolution. For 5v this would be about 19.5mv.

Once you have this value (again, depends on the voltage range) you can then store this value in a register. And, when you convert your voltage to an 8-bit number, multiply the two together. Eg: You get 134 from a conversion. 134*19.5mv = 2617mV. The 'ol F84 doesn't have a hardware multiplier, but there are some simple tricks to do multiplication on PICs. And anyway, that is just one method of doing what you are trying to do.

Please inform us of your voltage range (minimum/maximum voltage to be sampled). Because sometimes, its easier to reduce the signal in analogue (voltage divider) and sampling over 1v to make it easier to convert voltages in software.

Hope this goes some way to helping you.

BuriedCode.
Back to top
Google
AdSense
Google Adsense




Post17 Mar 2006 19:51   

Ads




Back to top
theenes



Joined: 15 Sep 2005
Posts: 21


Post18 Mar 2006 4:52   

Re: how to convert 8bit binary to milivolt..in PIC16F84


thanks for ur reply..yes,u got the right understanding of my question..
so,actually the reference voltage is from the range of 0 to 5 volt..and as u said the resolution is 19.5mv..so how do i do multiplication for pic16f84?..for example..if i get the 10001111,so in decimal is 143..so it must be times by 143*19.5mv..to get the answer,rite..how to do it?i hope u can help me with the coding...i hope u will guide me..appreciate ur help a lot..
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> how to convert 8bit binary to milivolt..in PIC16F84
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
convert 8bit serial data from serial port to 8bit parallel (6)
how can i convert binary file (4)
how to convert binary to BCD or decimal in assembly (4)
(ASK) How to convert speech signal into binary??.. (3)
How to convert a PADS .pcb type(binary) to Altium? (1)
how to convert image,sound and text into binary in simulink (2)
Convert 8bit to 7bit for SMS using 89S52 (2)
Voice convert in to Binary (1)
Convert Hex to Binary in Perl? (6)
Convert 26 bit binary to BCD Routine (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS