Searching \ for '[PIC] ADC code generator' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/ios.htm?key=adc
Search entire site for: 'ADC code generator'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] ADC code generator'
2006\01\15@200403 by Chetan Bhargava

picon face
I've been working with the ADC code generator below and was wondering
how the output is arranged is CVD00 is LSB or MSB? I just want to
consider two digits plus one after decimal.

http://www.piclist.com/techref/A2DCodeGenerator.asp

Any help would be appreciated.

Thanks,

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\15@213432 by James Newton, Host

face picon face
> I've been working with the ADC code generator below and was
> wondering how the output is arranged is CVD00 is LSB or MSB?
> I just want to consider two digits plus one after decimal.
>
> www.piclist.com/techref/A2DCodeGenerator.asp
>
> Any help would be appreciated.
>
> Thanks,

CVD00 is the most significant digit or MSD of the result. Please note that
we JUST put that up the other day so I'm not totally sure it is correct.

---
James Newton: PICList webmaster/Admin
spam_OUTjamesnewtonTakeThisOuTspampiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com


2006\01\16@015128 by Chetan Bhargava

picon face
I generated code for the full scale reading of 20

As my adc is 8 bit so I clear out ADHIGH and mov ADRES to ADLOW.

What I get in CVD00 - CVD05 is 049810 Is this what should I get?



       ;we are trying the new sub from piclist CVDEC
       movlw 0xff
       movwf ADLOW
       clrf  ADHIGH
       call CVDEC
       
       movf  CVD03,w
       movwf hundreds
       movf  CVD04,w
       movwf tens
       movf  CVD05,w
       movwf units
       call display ; display 3 digits



On 1/15/06, James Newton, Host <.....jamesnewtonKILLspamspam@spam@piclist.com> wrote:

> CVD00 is the most significant digit or MSD of the result. Please note that
> we JUST put that up the other day so I'm not totally sure it is correct.

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\16@015903 by Chetan Bhargava

picon face
In my las email I wrote that I mov adres to adlow. Please disregard that.
I mov 0xff to adlow to see if I get full scale reading or not. I even
tried moving 0x03 to adhigh (to see if I get full scale reading) but I
get the same result!


On 1/15/06, Chetan Bhargava <cbhargavaspamKILLspamgmail.com> wrote:
{Quote hidden}

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\16@160828 by Bill & Pookie

picon face

Right now the program on the web has a 'issue'.  When it is working properly
you should be able to obtain 8 bit results by multiplying your reference by
4 before you enter it.  So tell it reference is 80 and put zero in ADHIGH
and it will convert the eight bits in ADLOW. Me thinks....

A work around right now is to take the code you have and mod it a little.

the code for the high order bit of the convert with 10 bits and 20 volt
reference is as follows

-----
;  for bit 0    10

CVDEC00
       BTFSS        ADHIGH,06
       GOTO        CVDEC01

       MOVLW        D'01'
       ADDWF        CVD0-----
The remark tells you that the msb  (bit 0 of 10 bits) has a value of 10.
What you want to do is to change the bit test from bit 6 of ADHIGH to bit 0
of ADLOW.  And it will use CVD0as ten's digit, CVD1 as units     and CVD2...
as the decimals.

The next section should be changed to test ADLOW bit 1 and it adds a 5 to
CVD1.  You can see what each section is doing by looking at the value in the
remark preceding it.  What you get from the web is just code, you can modify
it any way you wish and all the time "what you see is what you get.".  I am
trying to say that nothing is going to affect or change the code except you.

So if you modify code as above, you will use CVD0, CVD1 decimal point CVD2.
But I would recommend you use CVD3 while testing the bits and when you
normalize the digits, start at CVD3 and work up through CVD1 so you get
better precision.

Look at the code and see what it is doing, you will have no problem
understanding it and making mods for your needs.

Bill

{Original Message removed}

2006\01\16@165204 by Bill & Pookie

picon face
Enter a reference of 80 (4 * 20) and you will get full scale readding if
19.9 something.  What uou get now is full sacle reading of 20/4 or 5 volts.
or 4.9 something.

Bill

{Original Message removed}

2006\01\16@171447 by Chetan Bhargava

picon face
Hi Bill,

Thanks for the correction there. Hope James will fix the web soon.
I'll try the changes you mentioned tonight.

Regards,


On 1/16/06, Bill & Pookie <EraseMEreddxspam_OUTspamTakeThisOuTcomcast.net> wrote:
> Enter a reference of 80 (4 * 20) and you will get full scale readding if
> 19.9 something.  What uou get now is full sacle reading of 20/4 or 5 volts.
> or 4.9 something.
>
> Bill


--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\16@181801 by James Newton, Host

face picon face
> Hi Bill,
>
> Thanks for the correction there. Hope James will fix the web soon.
> I'll try the changes you mentioned tonight.

I done fixed it hours ago... <grin>

At least I think I did...

James.



{Quote hidden}

> -

2006\01\17@003739 by Chetan Bhargava

picon face
I re-generated the code from the web with full scale reading of 80. I
moved 0xff into adlow and 0x00 to adhigh. I got 019922. As my display
is not ASCII, I don't convert the result of CVDEC to ASCII. I
commented the lines below

;   convert to ascii

;        MOVLW        D'48'

;        ADDWF        CVD00,F
;        ADDWF        CVD01,F
;        ADDWF        CVD02,F
;        ADDWF        CVD03,F
;        ADDWF        CVD04,F
;        ADDWF        CVD05,F

;        max value a/d is 79.922

Later I started puting the ADRES valued in ADLOW and displayed CVD1,
CVD2, CVD3 I got erratic results on the display when I varied the ADC
input. Something like 01.0, 15.0, 02.5 on increasing the ADC input.
Looks like messed up display.

My hardware: PIC16F716, 8bit ADC, 3 digit scanning mux display.


I get good linear results when I take the following route

multiply ADRES with 0.78125
convert binary to BCD
call display

here is my code

main:
       ;start the conversion
       call convert                ;start the adc and get the result
       
       ;ADRES has the conversion result here
       movf ADRES,w

       ;we are trying the new sub from piclist CVDEC
       movwf ADLOW
       movlw 0x00
       movwf ADHIGH
       call CVDEC
       
       ;CVD1 - hundreds
       ;CVD2 - Tens
       ;CVD3 - Units
       ;decimal between tens and units        

       movf  CVD01,w
       movwf hundreds
       movf  CVD02,w
       movwf tens
       movf  CVD03,w
       movwf units

       ;movwf ACC0        ;--somewhat working procedure
       ;call divide         ; generats linear result

       ;call binary to BCD
       ;movf ACC0,w
       ;movwf bin
       ;call binary_to_BCD

       call display         ;refrersh three 7seg digits
       
       goto main                ;repeat allover again

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\17@072540 by Bill & Pookie

picon face

----- Original Message -----
From: "Chetan Bhargava" <@spam@cbhargavaKILLspamspamgmail.com>
To: "Microcontroller discussion list - Public." <KILLspampiclistKILLspamspammit.edu>
Sent: Monday, January 16, 2006 9:37 PM
Subject: Re: [PIC] ADC code generator


>I re-generated the code from the web with full scale reading of 80. I
> moved 0xff into adlow and 0x00 to adhigh. I got 019922. As my display
> is not ASCII, I don't convert the result of CVDEC to ASCII. I

019 point 922 is what you got.  With full scale 4 * 20, hex 0ff would give
you 019.922.  using 8 bts that is good

Full scale of 255 times your conversion factor of 0.78125 gives me
199.21875.

But you have a way of doing it, so all is good in pic land.

All the code generator does is to calculate the decimal value (to 3 decimal
places) for each bit of the 10 bits of a/d using the 'ref' you gave it as
full scale value.  Then it outputs the code to test each of the 10 bits and
if bit is set,, add the decimal value to the proper digit byte.  As some
digit bytes may have a value greater than 9 in ut, so next it goed through
and for each digit that contains a value greater than 9, it subtracts 10 and
adds 1 to the next hugher digit byte.  At the end it adds a hex 30 to each
digit byte so that values 0 through 9 becomes ascii characters 0 through 9.
You could write same code by hand but it would involve som calculations and
writting many instructions.  This hand coding would be tedious and prone to
introduction of errors.

Bill

--------
{Quote hidden}

> --

2006\01\17@130256 by Chetan Bhargava

picon face
On 1/17/06, Bill & Pookie <RemoveMEreddxTakeThisOuTspamcomcast.net> wrote:

> 019 point 922 is what you got.  With full scale 4 * 20, hex 0ff would give
> you 019.922.  using 8 bts that is good

I discard the leftmost digit (CVD00) and use CVD01, CVD02, CVD03 with
a fixed decimal between CVD02 and CVD03. I get the reading right if I
use fixed value in ADLOW but as I rotate the pot on ADC input, the
reading I get is non linear. Tonight I'll do some more tinkering by
applying a set of fixed values to ADLOW and note the  display results.

> Full scale of 255 times your conversion factor of 0.78125 gives me
> 199.21875.

On the other hand if I use my code (multiply and BIN2BCD approach) I
get a linear reading from 00.1 to 19.8


> But you have a way of doing it, so all is good in pic land.

I used the following calculations

Vref=5v
ADCmax=255
ADCreading = x
Display = V
MaxIn  = 20v

Display=((x*Vref)/ADCmax)*(MaxIn/Vref)
Display=(x*5)/255 * (20/5)
      = x * 0.0196078431 * 4

The multiplier factor for the above situation is 0.078431372

Multiplying ADC reading with 0.0784313724 (0.0196078431*4) will yield
the voltage to be displayed

ADRES is 255 then the result would be 019.99999

To accommodate the result to my decimal point I multiply by 0.78431372 :-)

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\17@233022 by Chetan Bhargava

picon face
I used some data samples in ADLOW and took following readings.

ADLOW    Display
00              00.0
1F              19.3
3E              09.6
5D              14.5
7C              04.8
9B              16.9
BA              07.2
D9              12.1
FF              19.9

ADHIGH was 0x00 all the time. The three digits on the display were
CDV01, CDV02, CDV03

Don't seem to understand why the readings are non-linear?

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\18@073543 by Bill & Pookie

picon face
Can you include a copy of the code in question?

Bill

----- Original Message -----
From: "Chetan Bhargava" <spamBeGonecbhargavaspamBeGonespamgmail.com>
To: "Microcontroller discussion list - Public." <TakeThisOuTpiclistEraseMEspamspam_OUTmit.edu>
Sent: Tuesday, January 17, 2006 8:30 PM
Subject: Re: [PIC] ADC code generator


{Quote hidden}

> --

2006\01\18@120716 by Chetan Bhargava

picon face
;$Id: div2.asm,v 1.2 2006/01/17 01:24:47 chetan Exp $

;   Prigram to convert a ten bit a/d reading
;      to ascii decimal.  A/d reference is  20 volts.
;   CVD00 to CVD05 contains ascii decimal characters
;      wuth the decimal point being between CVD02 and CVD03
;  Put a/d reading in ADHIGH and ADLOW, call CVDEC
;     and get value from CVD00 through CVD05
.            Bill Cornutt   Jan 1, 2006


       cblock
CVD00
CVD01
CVD02
CVD03
CVD04
CVD05
ADHIGH
ADLOW
       endc


CVDEC

;    clear receiving bytes

       CLRF        CVD00
       CLRF        CVD01
       CLRF        CVD02
       CLRF        CVD03
       CLRF        CVD04
       CLRF        CVD05


;  for bit  0     10

CVDEC00
       BTFSS        ADHIGH,06
       GOTO        CVDEC01

       MOVLW        D'01'
       ADDWF        CVD01,F



;  for bit  1     5

CVDEC01
       BTFSS        ADHIGH,07
       GOTO        CVDEC02

       MOVLW        D'05'
       ADDWF        CVD02,F



;  for bit  2     2.5

CVDEC02
       BTFSS        ADLOW,00
       GOTO        CVDEC03

       MOVLW        D'02'
       ADDWF        CVD02,F

       MOVLW        D'05'
       ADDWF        CVD03,F



;  for bit  3     1.25

CVDEC03
       BTFSS        ADLOW,01
       GOTO        CVDEC04

       MOVLW        D'01'
       ADDWF        CVD02,F

       MOVLW        D'02'
       ADDWF        CVD03,F

       MOVLW        D'05'
       ADDWF        CVD04,F



;  for bit  4     0.625

CVDEC04
       BTFSS        ADLOW,02
       GOTO        CVDEC05

       MOVLW        D'06'
       ADDWF        CVD03,F

       MOVLW        D'02'
       ADDWF        CVD04,F

       MOVLW        D'05'
       ADDWF        CVD05,F



;  for bit  5     0.3125

CVDEC05
       BTFSS        ADLOW,03
       GOTO        CVDEC06

       MOVLW        D'03'
       ADDWF        CVD03,F

       MOVLW        D'01'
       ADDWF        CVD04,F

       MOVLW        D'03'
       ADDWF        CVD05,F



;  for bit  6     0.15625

CVDEC06
       BTFSS        ADLOW,04
       GOTO        CVDEC07

       MOVLW        D'01'
       ADDWF        CVD03,F

       MOVLW        D'05'
       ADDWF        CVD04,F

       MOVLW        D'06'
       ADDWF        CVD05,F



;  for bit  7     0.078125

CVDEC07
       BTFSS        ADLOW,05
       GOTO        CVDEC08

       MOVLW        D'07'
       ADDWF        CVD04,F

       MOVLW        D'08'
       ADDWF        CVD05,F



;  for bit  8     0.0390625

CVDEC08
       BTFSS        ADLOW,06
       GOTO        CVDEC09

       MOVLW        D'03'
       ADDWF        CVD04,F

       MOVLW        D'09'
       ADDWF        CVD05,F



;  for bit  9     0.01953125

CVDEC09
       BTFSS        ADLOW,07
       GOTO        CVDEC10

       MOVLW        D'02'
       ADDWF        CVD04,F


CVDEC10
       MOVLW        D'10'

;   adjust digit  5

       INCF        CVD04,F
       SUBWF        CVD05,F
       BTFSC        STATUS,C
       GOTO        $-3

       ;  went past zero

       DECF        CVD04,F
       ADDWF        CVD05,F

;   adjust digit  4

       INCF        CVD03,F
       SUBWF        CVD04,F
       BTFSC        STATUS,C
       GOTO        $-3

       ;  went past zero

       DECF        CVD03,F
       ADDWF        CVD04,F

;   adjust digit  3

       INCF        CVD02,F
       SUBWF        CVD03,F
       BTFSC        STATUS,C
       GOTO        $-3

       ;  went past zero

       DECF        CVD02,F
       ADDWF        CVD03,F

;   adjust digit  2

       INCF        CVD01,F
       SUBWF        CVD02,F
       BTFSC        STATUS,C
       GOTO        $-3

       ;  went past zero

       DECF        CVD01,F
       ADDWF        CVD02,F

;   adjust digit  1

       INCF        CVD00,F
       SUBWF        CVD01,F
       BTFSC        STATUS,C
       GOTO        $-3

       ;  went past zero

       DECF        CVD00,F
       ADDWF        CVD01,F


       ;  no need to adjust high order byte

;   convert to ascii

       MOVLW        D'48'

       ADDWF        CVD00,F
       ADDWF        CVD01,F
       ADDWF        CVD02,F
       ADDWF        CVD03,F
       ADDWF        CVD04,F
       ADDWF        CVD05,F

;        max value a/d is 19.981

       RETURN



On 1/18/06, Bill & Pookie <RemoveMEreddxspamTakeThisOuTcomcast.net> wrote:
> Can you include a copy of the code in question?
>
> Bill


--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\18@162627 by Bill & Pookie

picon face
part 1 9406 bytes content-type:text/plain; format=flowed; charset="iso-8859-1"; (decoded 7bit)

The program was written to output code for 10 bit ADC's.  As max value of a
8 bit ADC is 1/4 that of a 10 bit ADC, you will have to enter a full scale
reading, or 'Ref', that is 4 times the full scale reading of the 8 bit ADC.
In your case this would be 80 for a full scale reading of 20 using 8 bits.
As you do not use ADHIGH I have marked the main parts that use ADHIGH and
they can be deleted, but don't have to be deleted as long as ADHIGH is zero.

I have went to the generator site and entered 80 as reference and attached
output with my ADHIGH comments.  You will notice that at bottom of code
there is a remark   "max value a/d is 79.922".  This is the sum of the 10
bits for a Ref of 80,

Here is web site to get new copy of code, That is where I obtained the
attached code.  Just enter 80 as 'Ref'
http://www.piclist.com/techref/A2DCodeGenerator.asp

While you only want one decimal place results, it is necessary to calculate
to at least two decimal places in order to insure better results.  The
program calculates to three decimal places.

This program is "bit" orientated.  All it does is add up the value for each
bit set in the ADC reading.  Looking at the code for the 8 bits (my code,
not yours) you see the comments

;  for bit  2     10
;  for bit  3     5
;  for bit  4     2.5
;  for bit  5     1.25
;  for bit  6     0.625
;  for bit  7     0.3125
;  for bit  8     0.15625
;  for bit  9     0.078125

This shows the value for a 10 bit ADC with Ref of 80.  So the bit numbers
are off by 2 for a 8 bit ADC.  Bit 2 is bit 0 of ADLOW through bit 9 being
bit 7 of 8 bit ADC.  These remarks also show the decimal values each bit
represents.

Renumbered bits for clairity on 8 bit ADC

;  for bit  0    10
;  for bit  1     5
;  for bit  2     2.5
;  for bit  3     1.25
;  for bit  4     0.625
;  for bit  5     0.3125
;  for bit  6     0.15625
;  for bit  7     0.078125

And the "collector" bytes
CVD00    collectes hundreds
CVD01    collectes tens
CVD02    collectes  units
CVD03    collectes  tenths
CVD04    collectes  hundreths
CVD05    collectes  thousands

So if bit 0 of ADC is set, then 1 is added to the tens byte.  If bit 1 set,
add 5 to units.  Bit 2 set, add 2 to units and 5 to tentjs.  So on until, if
bit 7 set then add 7 to hundreths and 8 to thousands.

Using this method it is likely that some collector bytes will have a value
greater than 9.  so there is a need to adjust each bite so that it's value
is from 0 to 9.  If a value of a byte is greater than 9 (10 or more) we
subtract 10 from it and add 1 to the next higher byte.  We keep doing that
to a byte until it's value is between 0 and 9.  Then we go to the next
higher byte and do the same.  It is important that we start with the least
sunficiant byte (LSByte) and work our way up the food chain.    So the
program starts doing this with CVD05, then CVD04 till CVD01.  CVD00 should
never be 10 or greater as the 'Ref' shouldn't be that high if using this
code unmodified.

Using this method of accumulating values, care needs to be taken in hwo many
counts can go into each collector byte maximum.  As when the count exceds
255, it goes to 0 and the counts are lost.  But in our case we are adding a
max of 9 for ten bits and 10 bits possible from previous byte's adding for
each 10 counts in it, the most ever would be a count of 100.  So that is ok.

The method for adjusting each collector byte is the "sorry" method.  Like
when you go to the doctor.  He does not preform tests on you to see what may
be sore, he just pokes you till you say "ouch".  Then he says "sorry" and
hands you a piece of candy.  The program does not test to see what the value
of a byte is, it just increments the next higher byte by 1 and subtracts 10
from the current byte.  When it has went too far, the carry will be set
"ouch".  So undo  that increment and subtract by a decrement or next higher
byte "sorry" and adding 10 back to the current bytw "here is a piece of
candy".

Changing a decimal value in a byte to an ascii character requires setting
bits 2 and 3 (32 hex) of the byte.  So the program just adds decimal 48 to
each byte.

The code generator program was written to simply converting ADC reading to
decimal character.  The same program could be written  by hand but with the
calculations and typing necessary, it would be subject to errors and time
consuming.  Also code can easily be generated for a different 'Ref' just by
going to the web site.  In fact it should be possible tohave two or more
copies of same code in one program by doing a "find and replace" on the
lables of the other program's "CVDEC" and removing the duplicate register
assignments "cblocks"

So, go to web site and get new copy using a 'Ref' of 80 and it should work.

http://www.piclist.com/techref/A2DCodeGenerator.asp

If it don't then it may be time to forget this code and use what works.

Bill

---- Original Message -----
From: "Chetan Bhargava" <cbhargavaEraseMEspam.....gmail.com>
To: "Microcontroller discussion list - Public." <EraseMEpiclistspammit.edu>
Sent: Wednesday, January 18, 2006 9:07 AM
Subject: Re: [PIC] ADC code generator


{Quote hidden}

> --

2006\01\18@175610 by Chetan Bhargava

picon face
Hi Bill,

I have tried the ref value of 80 before that's why I got the reading
of 19.9 when I have 00ff in adhigh:adlow.

In my earlier posting I have tried 20 as ref and got 4.98 as reading on display.

Some time ago I wrote:
>I generated code for the full scale reading of 20
>As my adc is 8 bit so I clear out ADHIGH and mov ADRES to ADLOW.
>What I get in CVD00 - CVD05 is 049810 Is this what should I get?

I just copied the actual code from the web-generator, didn't bother to
update the comments. So the comments would be from old code
generation.

I'll try the code that you have attached and will let you know the results.

Regards,



On 1/18/06, Bill & Pookie <RemoveMEreddxspam_OUTspamKILLspamcomcast.net> wrote:
{Quote hidden}

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\18@231553 by Chetan Bhargava

picon face
part 1 1243 bytes content-type:text/plain; charset=ISO-8859-1 (decoded quoted-printable)

Replaced old code with Bill's code, reran the tests, got following
results (exactly same as before).

ADLOW    Display
00              00.0
1F              19.3
3E              09.6
5D              14.5
7C              04.8
9B              16.9
BA              07.2
D9              12.1
FF              19.9

ADHIGH was 0x00 all the time. The three digits on the display were
CDV01, CDV02, CDV03


The main calling procedure is:

main:
       ;start the conversion
       call convert                ;start the adc and get the result
       
       ;ADRES has the conversion result here
       movf ADRES,w

       ;we are trying the new sub from piclist CVDEC
       movlw 0xff
       movwf ADLOW
       movlw 0x00
       movwf ADHIGH
       call CVDEC
       
       ;CVD1 - hundreds
       ;CVD2 - Tens
       ;CVD3 - Units
       
       movf  CVD01,w
       movwf hundreds
       movf  CVD02,w
       movwf tens
       movf  CVD03,w
       movwf units

       ;movwf ACC0        ;--somewhat working procedure
       ;call divide


       ;testing binary_to_bcd by forcing bin below
       ;movlw d'200'
       
       ;call binary to BCD
       ;movf ACC0,w
       ;movwf bin
       ;call binary_to_BCD

       call display
       
       goto main                ;repeat allover again



Bill's code that was assembled is attached.

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com


part 2 2896 bytes content-type:application/x-troff; name=div2.asm (decode)

part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)

2006\01\19@014947 by Bill & Pookie

picon face

Found the problem from your data.  I have the bits of the byte numbered in
reverse.  Where I do a "BTFSS ADLOW,00" it should be bit 07 instead of 00.
Bit 1 should be 06....and bit 7 is 00.  And the same for all the bit tests
of ADHIGH.

I did do some limited testing on the program and thought it worked.  For the
fully untested code, I apologize..

The problem became apparent by looking for what hex values resulted in a
display with 10 or 5 in it.  hex 1F is 19.3, so it has both 10 and 5.   hex
3E just has 5,   hex 5D just has 10.

0001 1111     10     5
0011 1110              5
0101 1101      10

xxxx xxx1    bits only on when 10
xxxx xx1x    bits only on when 5

So it looks like I am testing low order bit when should be testing high
order bit..

Bill

{Original Message removed}

2006\01\19@022258 by Chetan Bhargava

picon face
Don't apologize Bill, All of us understand that the free stuff comes
with no warranty. I saw some new code and decided to test it. I was
working on a similar app so I was inerested. I had the complex code
working anyways :-)

Maybe your code and my testing would benefit someone.

I'll modify the code and will post the results tomorrow.

Regards,

Chetan


On 1/18/06, Bill & Pookie <RemoveMEreddxKILLspamspamcomcast.net> wrote:
{Quote hidden}

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

2006\01\19@070251 by Bill & Pookie

picon face
That should do it.

Bill

----- Original Message -----
From: "Chetan Bhargava" <cbhargavaSTOPspamspamspam_OUTgmail.com>
To: "Microcontroller discussion list - Public." <spamBeGonepiclistSTOPspamspamEraseMEmit.edu>
Sent: Wednesday, January 18, 2006 11:22 PM
Subject: Re: [PIC] ADC code generator


{Quote hidden}

> --

2006\01\25@044847 by Chetan Bhargava

picon face
The new code generator works fine :-)
I just tested with the values from ADC and the display reads from 00.0
to 19.8 LINEAR! :-)

If one was not follwoing the thread, the code that was tested can be
generated from here:
http://www.piclist.com/techref/a2dcodegenerator.asp

Regards,

--
Chetan Bhargava
Web: http://www.bhargavaz.net
Blog: http://microz.blogspot.com

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...