Tlc2543
Archiver
Posts: 46,084
Hi All,
I am getting odd results from a TLC2543. I can only get figures between 3000
or so to 4095. I have tried it on a 2SX and a 2P, same results. I am using
the code from Tracy's web site.
Thanks,
Jonathan
I am getting odd results from a TLC2543. I can only get figures between 3000
or so to 4095. I have tried it on a 2SX and a 2P, same results. I am using
the code from Tracy's web site.
Thanks,
Jonathan
Comments
jpeakall@m... writes:
> I am getting odd results from a TLC2543. I can only get figures between
> 3000
> or so to 4095. I have tried it on a 2SX and a 2P, same results. I am using
> the code from Tracy's web site.
>
>
Do you have Ref+ tied to Vcc and Ref- tied to Vss?
Sid Weaver
W4EKQ
Port Richey, FL
[noparse][[/noparse]Non-text portions of this message have been removed]
Thanks,
Jonathan
Original Message
From: <Newzed@a...>
To: <basicstamps@yahoogroups.com>
Sent: Monday, July 21, 2003 1:58 PM
Subject: Re: [noparse][[/noparse]basicstamps] TLC2543
> In a message dated 7/21/2003 4:49:28 PM Eastern Standard Time,
> jpeakall@m... writes:
>
>
> > I am getting odd results from a TLC2543. I can only get figures between
> > 3000
> > or so to 4095. I have tried it on a 2SX and a 2P, same results. I am
using
> > the code from Tracy's web site.
> >
> >
>
> Do you have Ref+ tied to Vcc and Ref- tied to Vss?
> Sid Weaver
> W4EKQ
> Port Richey, FL
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
jpeakall@m... writes:
> Ref+ is tied to Vdd, ref- to Vss.
>
>
OK, Jonathan. I have used the TLC for a long time with great success. Since
I can't see the setup you have I can only ask dum questions.
Are you trying to input more that 5 VDC?
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
No, I'm using the Vdd off the BOE for both Vref and supply. The schematic on
Tracy's site shows no other components, and neither does the data sheet. I
have Vss to p13 and p10 pf the TLC, Vdd to 20 and 14, pins 15-18 are
coneccted to the Stamp pins 1-4 and that is it.
Could it be that I need to be waiting for the end of conversion flag?
Tracy's site says BS2 do not need to as they are too slow, but what about
the 2SX and 2P? Perhaps they are fast enough to need this. Any idea how I
would check?
Thanks,
Jonathan
Original Message
From: <Newzed@a...>
To: <basicstamps@yahoogroups.com>
Sent: Monday, July 21, 2003 2:17 PM
Subject: Re: [noparse][[/noparse]basicstamps] TLC2543
> In a message dated 7/21/2003 5:10:05 PM Eastern Standard Time,
> jpeakall@m... writes:
>
>
> > Ref+ is tied to Vdd, ref- to Vss.
> >
> >
>
> OK, Jonathan. I have used the TLC for a long time with great success.
Since
> I can't see the setup you have I can only ask dum questions.
>
> Are you trying to input more that 5 VDC?
>
> Sid
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
Stamp. The '2543 conversion time is less than 10 microseconds.
Have the program run through channels 11, 12 and 13 for test
purposes. The result should be count=2048, Vref/2, count=0 and
count=4095. That is a good interface test.
The example at <http://www.emesys.com/OWL2face.htm> uses connections
to stamp pins p12 to p15, while you are using p1 to p4. Be sure pins
are right! It's awfully easy to let a typo slip in, in particular
with respect to the sense of sdo and sdi. Sid pointed out a typo on
my web page a long time ago, but I hope I corrected that! (Thanks
Sid!)
With a 5.00 volt reference, the conversion from counts to millivolts
is a little different.
result = result ** 14464 + result
or conditional on the flag, like in the example
result = adv * result ** 14464 + result
or PBASIC 2.5
if adv then
millivolts=result ** 14464 + result
else
millivolts=result
endif
The conversion factor is 5000/4096 = 1.2207
-- Tracy
>Sid,
>
>No, I'm using the Vdd off the BOE for both Vref and supply. The schematic on
>Tracy's site shows no other components, and neither does the data sheet. I
>have Vss to p13 and p10 pf the TLC, Vdd to 20 and 14, pins 15-18 are
>coneccted to the Stamp pins 1-4 and that is it.
>
>Could it be that I need to be waiting for the end of conversion flag?
>Tracy's site says BS2 do not need to as they are too slow, but what about
>the 2SX and 2P? Perhaps they are fast enough to need this. Any idea how I
>would check?
>
>Thanks,
>
>Jonathan
>
>
Original Message
>From: <Newzed@a...>
>To: <basicstamps@yahoogroups.com>
>Sent: Monday, July 21, 2003 2:17 PM
>Subject: Re: [noparse][[/noparse]basicstamps] TLC2543
>
>
>> In a message dated 7/21/2003 5:10:05 PM Eastern Standard Time,
>> jpeakall@m... writes:
>>
>>
>> > Ref+ is tied to Vdd, ref- to Vss.
>> >
>> >
>>
>> OK, Jonathan. I have used the TLC for a long time with great success.
>Since
>> I can't see the setup you have I can only ask dum questions.
>>
>> Are you trying to input more that 5 VDC?
>>
>> Sid
>>
>>
>> [noparse][[/noparse]Non-text portions of this message have been removed]
>>
>>
>> To UNSUBSCRIBE, just send mail to:
>> basicstamps-unsubscribe@yahoogroups.com
>> from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>>
>>
>> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>>
>>
>>
>>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the
>Subject and Body of the message will be ignored.
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
It seems to have been a bum chip. I tried another and it works fine. Odd
thing though, any input that isn't connected to Vss via a pulldown resistor
"follows" the input that I am testing by about 1/2. Meaning, an input that
doens't have a pulldown will show 500 if I have 1000 on an input I am
testing. Hope that makes sense.
Thanks for the correction for a 5V Vref!
Jonathan
Original Message
From: "Tracy Allen" <tracy@e...>
To: <basicstamps@yahoogroups.com>
Sent: Monday, July 21, 2003 3:58 PM
Subject: Re: [noparse][[/noparse]basicstamps] TLC2543
> It should not be necessary to check the EOC flag when using any
> Stamp. The '2543 conversion time is less than 10 microseconds.
>
> Have the program run through channels 11, 12 and 13 for test
> purposes. The result should be count=2048, Vref/2, count=0 and
> count=4095. That is a good interface test.
>
> The example at <http://www.emesys.com/OWL2face.htm> uses connections
> to stamp pins p12 to p15, while you are using p1 to p4. Be sure pins
> are right! It's awfully easy to let a typo slip in, in particular
> with respect to the sense of sdo and sdi. Sid pointed out a typo on
> my web page a long time ago, but I hope I corrected that! (Thanks
> Sid!)
>
> With a 5.00 volt reference, the conversion from counts to millivolts
> is a little different.
> result = result ** 14464 + result
> or conditional on the flag, like in the example
> result = adv * result ** 14464 + result
> or PBASIC 2.5
> if adv then
> millivolts=result ** 14464 + result
> else
> millivolts=result
> endif
>
> The conversion factor is 5000/4096 = 1.2207
>
> -- Tracy
>
>
>
>
> >Sid,
> >
> >No, I'm using the Vdd off the BOE for both Vref and supply. The schematic
on
> >Tracy's site shows no other components, and neither does the data sheet.
I
> >have Vss to p13 and p10 pf the TLC, Vdd to 20 and 14, pins 15-18 are
> >coneccted to the Stamp pins 1-4 and that is it.
> >
> >Could it be that I need to be waiting for the end of conversion flag?
> >Tracy's site says BS2 do not need to as they are too slow, but what about
> >the 2SX and 2P? Perhaps they are fast enough to need this. Any idea how I
> >would check?
> >
> >Thanks,
> >
> >Jonathan
> >
> >
Original Message
> >From: <Newzed@a...>
> >To: <basicstamps@yahoogroups.com>
> >Sent: Monday, July 21, 2003 2:17 PM
> >Subject: Re: [noparse][[/noparse]basicstamps] TLC2543
> >
> >
> >> In a message dated 7/21/2003 5:10:05 PM Eastern Standard Time,
> >> jpeakall@m... writes:
> >>
> >>
> >> > Ref+ is tied to Vdd, ref- to Vss.
> >> >
> >> >
> >>
> >> OK, Jonathan. I have used the TLC for a long time with great success.
> >Since
> >> I can't see the setup you have I can only ask dum questions.
> >>
> >> Are you trying to input more that 5 VDC?
> >>
> >> Sid
> >>
> >>
> >> [noparse][[/noparse]Non-text portions of this message have been removed]
> >>
> >>
> >> To UNSUBSCRIBE, just send mail to:
> >> basicstamps-unsubscribe@yahoogroups.com
> >> from the same email address that you subscribed. Text in the Subject
and
> >Body of the message will be ignored.
> >>
> >>
> >> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >>
> >>
> >>
> >>
> >
> >
> >To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> >from the same email address that you subscribed. Text in the
> >Subject and Body of the message will be ignored.
> >
> >
> >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
I just took a project off the breadboard and on to a PCB. I am getting very
odd results from a TLC2543. At about 3.6VDC into one of the ADC inputs, the
chip outputs around 1000. Below that it goes to 0. Above that it suddenly
jumps to 4096. All of the channels act the same. I have a .1 and .01uF caps
on the power leads, and the Vref pin is connected to the VCC pin. I have
tried using another chip, with the same results. I have tried Tracy's code,
and got the same results.
Any ideas?
Jonathan
www.madlabs.info
jpeakall@m... writes:
> I just took a project off the breadboard and on to a PCB. I am getting very
> odd results from a TLC2543. At about 3.6VDC into one of the ADC inputs, the
> chip outputs around 1000. Below that it goes to 0. Above that it suddenly
> jumps to 4096. All of the channels act the same. I have a .1 and .01uF caps
> on the power leads, and the Vref pin is connected to the VCC pin. I have
> tried using another chip, with the same results. I have tried Tracy's code,
> and got the same results.
>
Can I see your code, Jonathan.
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
> >
>
> Can I see your code, Jonathan.
>
Below are 2 snippets that give the same results. I am using a 2p40, and the
pins are connected as follows-
I/O pin 12 to pin 15, chip select
I/O pin 13 to pin 16, data out
I/O pin 14 to pin 17, data in
I/O pin 15 to pin 18, I/O clock
Snippet one:
'{$STAMP BS2p}
'{$PBASIC 2.5}
ADch VAR Nib ' selects AD channel 0-10
ADV VAR Bit ' selects result as 0:count; 1:millivolt
result VAR Word ' result, 12 bit A/D conversion
ADv=1 ' Puts the ADC in millivot mode, 0 puts it in raw
count mode
Main:
ADCh =1 ' specify one of 11 input channels
GOSUB ADread ' get millivOLT data FRom that channel
PAUSE 1000 ' demo delay
'DEBUG HOME ' repeat the demo, refreshes the debug screen
GOTO MAIN
ADrEAD: ' entry point to give result as millivolts
MAINIO
LOW 12 ' select chip
PAUSE 5 ' Settling delay
SHIFTOUT 14,15,MSBFIRST,[noparse][[/noparse]ADch<<8\12] ' mode, left justify ADch
SHIFTIN 13,15,MSBPRE,[noparse][[/noparse]result\12] ' get result, 12 bits
resulT = aDv * rESULt ** 14464 + result ' Does the integer math conversion
DEBUG DEC ADch,": ",DEC result,REP 32\5,CR ' display results
'ADCH=14 ' THIS command puts the ADC into sleep mode
'SHIFTOUT 14,18,MSBFIRST,[noparse][[/noparse]ADch<<8\12] ' Send sleep command
HIGH 12 ' deselect chip
RETURN
Here is snippet 2:
'{$STAMP BS2p}
' ADread subroutine for OWL2c.
' On command, returns 12 bit digital data from one of 11 analog channels.
' The value of ADch from 0 to 10 selects external analog inputs.
' ADch=14 puts the converter into its sleep mode.
' converter has 5.120 volt reference, for 1.25 mV per bit
sclk CON 15 ' SPI clock out from BS2 to AD2543
sdo CON 14 ' SPI data out from BS2 to AD2543 sdi
sdi CON 13 ' SPI data in from AD2543 sdo to BS2
ADcs CON 12 ' AD2543 chip select, active low
ADch VAR Nib ' selects AD channel 0-10
ADv VAR Bit ' selects result as 0:count; 1:millivolt
result VAR Word ' result, 12 bit A/D conversion
demo: ' to show off the subroutine below.
FOR ADch =0 TO 10 ' specify one of 11 input channels
GOSUB ADread ' get millivolt data from that channel
DEBUG DEC ADch,": ",DEC result,REP 32\5,CR ' display
NEXT
PAUSE 100 ' demo delay
DEBUG HOME ' repeat the demo
GOTO demo
ADread: ' entry point to give result as millivolts
ADv=1 ' in millivolts 0-5120
ADread0: ' enter here for result as raw count 0-4095
LOW ADcs ' select chip
PAUSE 5 ' settling delay
SHIFTOUT sdo,sclk,MSBFIRST,[noparse][[/noparse]ADch<<8\12] ' mode, left justify ADch
IF ADch=14 THEN ADexit ' ADch=14 puts it to sleep
SHIFTIN sdi,sclk,MSBPRE,[noparse][[/noparse]result\12] ' get result, 12 bits
ADexit: ' finish up
HIGH ADcs ' deselect chip
result = 64*ADv+256*/result ' if ADv=0, result=raw count
' if ADv=1, convert count->mV
' 1.25 millivolts per bit
ADv=0 ' default is raw count, not millivolts
RETURN
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
jpeakall@m... writes:
Something else, Jonathan. See below.
> MAINIO
> LOW 12 ' select chip
> PAUSE 5 ' Settling delay
> SHIFTOUT 14,15,MSBFIRST,[noparse][[/noparse]ADch<<8\12] ' mode, left justify ADch
> SHIFTIN 13,15,MSBPRE,[noparse][[/noparse]result\12] ' get result, 12 bits
Why are you using MSBPRE instead of MSBFIRST ?
> resulT = aDv * rESULt ** 14464 + result ' Does the integer math
> conversion
> DEBUG DEC ADch,": ",DEC result,REP 32\5,CR ' display results
> 'ADCH=14 ' THIS command puts the ADC into sleep mode
> 'SHIFTOUT 14,18,MSBFIRST,[noparse][[/noparse]ADch<<8\12] ' Send sleep command
> HIGH 12 ' deselect chip
>
[noparse][[/noparse]Non-text portions of this message have been removed]
decoupling capacitor very near the chip?
Al Williams
AWC
* Easy RS-232 Prototyping
http://www.al-williams.com/awce/rs1.htm
>
Original Message
> From: Jonathan Peakall [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=G4k1xslw10gAe0sgLRuRIUlYI6BHk0AOu2YUq_bDx9MbQd1CA4tQf-IUVK1EtBOnnw4doiWOIYAd0U4Z]jpeakall@m...[/url
> Sent: Sunday, August 24, 2003 3:42 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] TLC2543
>
>
> Hi All,
>
> I just took a project off the breadboard and on to a PCB. I
> am getting very odd results from a TLC2543. At about 3.6VDC
> into one of the ADC inputs, the chip outputs around 1000.
> Below that it goes to 0. Above that it suddenly jumps to
> 4096. All of the channels act the same. I have a .1 and .01uF
> caps on the power leads, and the Vref pin is connected to the
> VCC pin. I have tried using another chip, with the same
> results. I have tried Tracy's code, and got the same results.
>
> Any ideas?
>
> Jonathan
>
> www.madlabs.info
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
jpeakall@m... writes:
Something else, Jonathan. See below.
demo: ' to show off the subroutine below.
FOR ADch =0 TO 10 ' specify one of 11 input channels
GOSUB ADread ' get millivolt data from that channel
DEBUG DEC ADch,": ",DEC result,REP 32\5,CR ' display
NEXT
PAUSE 100 ' demo delay
DEBUG HOME ' repeat the demo
GOTO demo
You say "Gosub ADread"
> ADread: ' entry point to give result as millivolts
> ADv=1 ' in millivolts 0-5120
> ADread0: ' enter here for result as raw count 0-4095
> LOW ADcs ' select chip
> PAUSE 5 ' settling delay
> SHIFTOUT sdo,sclk,MSBFIRST,[noparse][[/noparse]ADch<<8\12] ' mode, left justify ADch
> IF ADch=14 THEN ADexit ' ADch=14 puts it to sleep
> SHIFTIN sdi,sclk,MSBPRE,[noparse][[/noparse]result\12] ' get result, 12 bits
> ADexit: ' finish up
> HIGH ADcs ' deselect chip
> result = 64*ADv+256*/result ' if ADv=0, result=raw count
> ' if ADv=1, convert count->mV
> ' 1.25 millivolts per bit
> ADv=0 ' default is raw count, not millivolts
return
Routine never sees "ADv = 0" Upon return, goes back to demo part, then
gosubs ADread, where ADv is reset to 1.
Sid
[noparse][[/noparse]Non-text portions of this message have been removed]
Duh, I forgot! One quick jumper on the bottom of the board, and we are in
business! Can't believe I forgot that and didn't spot it! Many thanks, it
works fine now.
Jonathan
www.madlabs.info
Original Message
From: <Newzed@a...>
To: <basicstamps@yahoogroups.com>
Sent: Sunday, August 24, 2003 2:37 PM
Subject: Re: [noparse][[/noparse]basicstamps] TLC2543
> Jonathan, do you have pin 13 tied to Vss and pin 14 tied to Vdd ?
>
> Sid
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
jpeakall@m... writes:
> Duh, I forgot! One quick jumper on the bottom of the board, and we are in
> business! Can't believe I forgot that and didn't spot it! Many thanks, it
> works fine now.
>
It's always something simple, Jonathan. Have fun !
[noparse][[/noparse]Non-text portions of this message have been removed]