A voltage divider on D0 so I'm not overdriving the Rabbit input gets me
rock solid conversion results now with the sample code -- thanks guys!
But I'm still having the problem that this same code once moved into a
program using RabbitWeb doesn't work (always returns 0).
The code is Samples\SPI\spi_test.c
I feel like it's something to do with the clock, printing SPIdivisor in
both situations give different results.
Any help would be appreciated,
/Carl
--- In r..., Steve Trigero wrote: >
> My mistake. I looked at the ADCV0831 datasheet, and that version of the part
can
> operate at 3.3V. And it seems like an easier part to use.
>
>
>
> >________________________________
> > From: Dave McLaughlin
> >To: r...
> >Sent: Wednesday, December 7, 2011 11:19 PM
> >Subject: RE: [rabbit-semi] Problems with SPI and ADC
> >
> >
> >
> >Hi Carl,
> >
> >The ADC0831 won't work at 3.3V
> >
> >It is specced at 4.5 to 5.5V so you either need to use a different ADC or use
a level translator between it and the RCM6700.
> >
> >
> >Dave…
> >
> >From:r... [mailto:r...] On Behalf Of cce32@...
> >Sent: 08 December 2011 13:08
> >To: r...
> >Subject: Re: [rabbit-semi] Problems with SPI and ADC
> >
> >
> >Yep, so simple, I should have asked earlier... since the 831 datasheet says
its a 5 volt chip I got confused.
> >
> >Thanks so much, I'll rewire tomorrow and try it out,
> >/Carl
> >
> >
> >
> >
> >
>
Reply by Steve Trigero●December 8, 20112011-12-08
My mistake. I looked at the ADCV0831 datasheet, and that version of the part
can
operate at 3.3V. And it seems like an easier part to use.
>________________________________
> From: Dave McLaughlin
>To: r...
>Sent: Wednesday, December 7, 2011 11:19 PM
>Subject: RE: [rabbit-semi] Problems with SPI and ADC
>
>Hi Carl,
>
>The ADC0831 won't work at 3.3V
>
>It is specced at 4.5 to 5.5V so you either need to use a different ADC or use a
level translator between it and the RCM6700.
>
>
>Dave…
>
>From:r... [mailto:r...] On Behalf Of c...@yahoo.com
>Sent: 08 December 2011 13:08
>To: r...
>Subject: Re: [rabbit-semi] Problems with SPI and ADC
>
>
>Yep, so simple, I should have asked earlier... since the 831 datasheet says its
a 5 volt chip I got confused.
>
>Thanks so much, I'll rewire tomorrow and try it out,
>/Carl
Reply by Dave McLaughlin●December 8, 20112011-12-08
Hi Carl,
The ADC0831 won't work at 3.3V
It is specced at 4.5 to 5.5V so you either need to use a different ADC or use a
level translator between it and the RCM6700.
Dave…
From: r... [mailto:r...] On Behalf Of c...@yahoo.com
Sent: 08 December 2011 13:08
To: r...
Subject: Re: [rabbit-semi] Problems with SPI and ADC
Yep, so simple, I should have asked earlier... since the 831 datasheet says its
a 5 volt chip I got confused.
Thanks so much, I'll rewire tomorrow and try it out,
/Carl
Reply by cce3...@yahoo.com●December 8, 20112011-12-08
Yep, so simple, I should have asked earlier... since the 831 datasheet says its
a 5 volt chip I got confused.
Thanks so much, I'll rewire tomorrow and try it out,
/Carl
On Dec 7, 2011, at 9:02 PM, Steve Trigero wrote:
>
> Correct. The R6000 is NOT 5V tolerant.
>
> The ADC supply should be changed to the same supply 3V as the Rabbit.
>
> From: Dave McLaughlin
> To: r...
> Sent: Wednesday, December 7, 2011 8:46 PM
> Subject: RE: [rabbit-semi] Problems with SPI and ADC
>
> Hello again Carl,
>
> Just a quick question.
>
> I see below you are powering the ADC0831 from 5V supply (ref at least so
assume the supply also)
>
> You are not connecting the DO pin direct to the processor are you?
>
> The Rabbit 6000 processor IO is 3.3V logic levels and there is no reference to
5V tolerance as there was with the 3000 processor.
>
> If this is the case, then the chances are you are seeing latchup on the IO
port because of the higher voltage and you also risk damage to the processor IO
pin.
>
>
> Dave…
>
>
> From: r... [mailto:r...] On Behalf Of c...@yahoo.com
> Sent: 08 December 2011 09:18
> To: r...
> Subject: Re: [rabbit-semi] Problems with SPI and ADC
>
>
> Basically I wired it according to the sample code and the SPI white paper:
>
> Pin 27 (PB0/SCLK) of the RCM6700 to Pin 7 (CLK) of the ADC0831
> Pin 34 (PB7) to Pin 1 (CS)
> Pin 24 (PC5) as MISO to Pin 6 (DO)
>
> In addition on the ADC I have Vcc (8) and Vref (5) tied to 5V
> And Gnd (4) and Vin- (3) tied to ground
> Vin+ (2) is what my rheostat setup is hooked to (verified with volt meter)
>
>
> /Carl
>
Reply by Steve Trigero●December 8, 20112011-12-08
Correct. The R6000 is NOT 5V tolerant.
The ADC supply should be changed to the same supply 3V as the Rabbit.
>________________________________
> From: Dave McLaughlin
>To: r...
>Sent: Wednesday, December 7, 2011 8:46 PM
>Subject: RE: [rabbit-semi] Problems with SPI and ADC
>
>Hello again Carl,
>
>Just a quick question.
>
>I see below you are powering the ADC0831 from 5V supply (ref at least so assume
the supply also)
>
>You are not connecting the DO pin direct to the processor are you?
>
>The Rabbit 6000 processor IO is 3.3V logic levels and there is no reference to
5V tolerance as there was with the 3000 processor.
>
>If this is the case, then the chances are you are seeing latchup on the IO port
because of the higher voltage and you also risk damage to the processor IO
pin.
>
>
>Dave…
>
>
>From:r... [mailto:r...] On Behalf Of c...@yahoo.com
>Sent: 08 December 2011 09:18
>To: r...
>Subject: Re: [rabbit-semi] Problems with SPI and ADC
>
>
>Basically I wired it according to the sample code and the SPI white paper:
>
>Pin 27 (PB0/SCLK) of the RCM6700 to Pin 7 (CLK) of the ADC0831
>Pin 34 (PB7) to Pin 1 (CS)
>Pin 24 (PC5) as MISO to Pin 6 (DO)
>
>In addition on the ADC I have Vcc (8) and Vref (5) tied to 5V
>And Gnd (4) and Vin- (3) tied to ground
>Vin+ (2) is what my rheostat setup is hooked to (verified with volt meter)
>
>
>/Carl
>
Reply by Dave McLaughlin●December 8, 20112011-12-08
Hello again Carl,
Just a quick question.
I see below you are powering the ADC0831 from 5V supply (ref at least so assume
the supply also)
You are not connecting the DO pin direct to the processor are you?
The Rabbit 6000 processor IO is 3.3V logic levels and there is no reference to
5V tolerance as there was with the 3000 processor.
If this is the case, then the chances are you are seeing latchup on the IO port
because of the higher voltage and you also risk damage to the processor IO
pin.
Dave…
From: r... [mailto:r...] On Behalf Of c...@yahoo.com
Sent: 08 December 2011 09:18
To: r...
Subject: Re: [rabbit-semi] Problems with SPI and ADC
Basically I wired it according to the sample code and the SPI white paper:
Pin 27 (PB0/SCLK) of the RCM6700 to Pin 7 (CLK) of the ADC0831
Pin 34 (PB7) to Pin 1 (CS)
Pin 24 (PC5) as MISO to Pin 6 (DO)
In addition on the ADC I have Vcc (8) and Vref (5) tied to 5V
And Gnd (4) and Vin- (3) tied to ground
Vin+ (2) is what my rheostat setup is hooked to (verified with volt meter)
/Carl
Reply by Dave McLaughlin●December 8, 20112011-12-08
Hi Carl,
Can you post the actual code you are using for this?
SPI issues are usually down to the timing as there is a 2 modes that the
clock works in. One is where it samples on the rising edge and the other on
the falling. These are referred to as MODE 0 and MODE 1.
CLK is used to clock the data into or out of the device.
The ADC0831 has an 11 bit clock and the Rabbit sample uses 16 bits and then
does a shift on the 2 bytes.
If you debug, what does these 2 bytes look like?
Do you have access to a scope to check the ADC is actually responding?
Cheers,
Dave.
From: r... [mailto:r...] On
Behalf Of cce32
Sent: 08 December 2011 06:31
To: r...
Subject: [rabbit-semi] Problems with SPI and ADC
I seem to be struggling with reading an analog voltage from a rheostat with
my RCM6700...
I've tried a couple of chips but let's discuss the simplest the
ADC831. I
started with the sample that calls for this chip in the header. My current
issue is that it outputs correct results intermixed with 0's and
255's. I
could filter these out in code but would like to determine the root cause.
In addition when I move this sample code into a program using RabbitWeb it
stops returning any valid results?
I think the main problem is I don't understand how the CLK should work
or
what the frequency of serial port B is being set at with the SPI or SPI_4k
libs.
The sample code has a for loop that iterates 10 times with a call to put CS
low and a comment that it's for the duration of the conversion?? How is
a
for loop connected to clock cycles??
Anyway sorry for the wordy question but any advice would be appreciated.
/Carl
Reply by cce3...@yahoo.com●December 7, 20112011-12-07
Basically I wired it according to the sample code and the SPI white paper:
Pin 27 (PB0/SCLK) of the RCM6700 to Pin 7 (CLK) of the ADC0831
Pin 34 (PB7) to Pin 1 (CS)
Pin 24 (PC5) as MISO to Pin 6 (DO)
In addition on the ADC I have Vcc (8) and Vref (5) tied to 5V
And Gnd (4) and Vin- (3) tied to ground
Vin+ (2) is what my rheostat setup is hooked to (verified with volt meter)
/Carl
On Dec 7, 2011, at 3:49 PM, Dan Allen wrote:
> What lines do you have going to your SPI device?
> You should have an in/out, a chip select, and clock.
>
> If you're missing the CS, I could see how you would
> Get these results.
>
> Dan...
>
> On Dec 7, 2011 6:38 PM, "cce32" wrote:
>
> I seem to be struggling with reading an analog voltage from a rheostat with my
RCM6700...
>
> I've tried a couple of chips but let's discuss the simplest the
ADC831. I started with the sample that calls for this chip in the header. My
current issue is that it outputs correct results intermixed with 0's and
255's. I could filter these out in code but would like to determine the
root cause. In addition when I move this sample code into a program using
RabbitWeb it stops returning any valid results?
>
> I think the main problem is I don't understand how the CLK should work or
what the frequency of serial port B is being set at with the SPI or SPI_4k
libs.
>
> The sample code has a for loop that iterates 10 times with a call to put CS
low and a comment that it's for the duration of the conversion?? How is a
for loop connected to clock cycles??
>
> Anyway sorry for the wordy question but any advice would be appreciated.
>
> /Carl
Reply by Dan Allen●December 7, 20112011-12-07
What lines do you have going to your SPI device?
You should have an in/out, a chip select, and clock.
If you're missing the CS, I could see how you would
Get these results.
Dan...
On Dec 7, 2011 6:38 PM, "cce32" wrote:
> **
> I seem to be struggling with reading an analog voltage from a rheostat
> with my RCM6700...
>
> I've tried a couple of chips but let's discuss the simplest the
ADC831. I
> started with the sample that calls for this chip in the header. My current
> issue is that it outputs correct results intermixed with 0's and
255's. I
> could filter these out in code but would like to determine the root cause.
> In addition when I move this sample code into a program using RabbitWeb it
> stops returning any valid results?
>
> I think the main problem is I don't understand how the CLK should work
or
> what the frequency of serial port B is being set at with the SPI or SPI_4k
> libs.
>
> The sample code has a for loop that iterates 10 times with a call to put
> CS low and a comment that it's for the duration of the conversion?? How
is
> a for loop connected to clock cycles??
>
> Anyway sorry for the wordy question but any advice would be appreciated.
>
> /Carl
>
>
>
Reply by cce32●December 7, 20112011-12-07
I seem to be struggling with reading an analog voltage from a rheostat with my
RCM6700...
I've tried a couple of chips but let's discuss the simplest the
ADC831. I started with the sample that calls for this chip in the header. My
current issue is that it outputs correct results intermixed with 0's and
255's. I could filter these out in code but would like to determine the
root cause. In addition when I move this sample code into a program using
RabbitWeb it stops returning any valid results?
I think the main problem is I don't understand how the CLK should work or
what the frequency of serial port B is being set at with the SPI or SPI_4k
libs.
The sample code has a for loop that iterates 10 times with a call to put CS low
and a comment that it's for the duration of the conversion?? How is a for
loop connected to clock cycles??
Anyway sorry for the wordy question but any advice would be appreciated.