Reply by Charlie W November 11, 20022002-11-11
Vrefp should be 1/3 below Vrefhi. If you got Vrefp
voltage is around 0.222V, either Vrefhi or Vreflo has
bad connection or you have a defective chip. I suggest
you to verify Vrefhi and Vreflo voltage.

Charlie W.

--- Jacob Christ <> wrote:
> Update:
>
> This morning I received some working tested code
> from Motorola for
> running the ADC on the 827. I tried it on my board
> with the same
> results as the sample apps from the targeting
> manual. So I think my
> code was working all along.
>
> I wanted to double check the ESD rating on the
> device in case it was
> more sensitive that I assumed. Turns out the 827
> Rev A silicon is
> 2000V HBM (human body model) on all pins except for
> the ADC pins,
> which are only 500V HBM. I unless it avived bad, I
> probably zapped
> my own part.
>
> My only other for sure experiance with knowing the
> ESD ratings and
> how easy they are to zap is that I worked on a team
> that was zaping
> 100V HBM chips while working with straps on waxed
> floors with
> grounded benches. While I was walking around with
> 2000V HBM chips in
> my bare hands on carpet with out any noticable
> destruction. I have
> also seen 300V HMB measured with an ESD meter while
> strapped to a
> grounded bench. So I'm sure I could have easly
> gotten to 500V HBM at
> my desk.
>
> Sigh...
>
> Jacob
>
> --- In motoroladsp@y..., "Jacob" <jacob@p...> wrote:
> >
> > The addition of the caps to Vss on my EVM did not
> help the
> problem. I can
> > see that the Vrefp output of the chip is at 0.000V
> on RESET. Upon
> > initalizing the ADC Vrefp jumps to 0.222V. I
> belive that the
> problem I'm
> > having is in the silicon of the chip. I can say
> though that the
> Motorola
> > and Metrowerks DSP guys (and gals) are responding
> marvelously,
> especially
> > Leonard (thanks).
> >
> > The 56F827 I have is marked with the following...
> >
> > PC56F827FG80
> > Rome Rev A
> > C63849.00 W#1
> > 0116
> >
> > Jacob >


__________________________________________________


Reply by Jacob Christ November 11, 20022002-11-11
Update:

This morning I received some working tested code from Motorola for
running the ADC on the 827. I tried it on my board with the same
results as the sample apps from the targeting manual. So I think my
code was working all along.

I wanted to double check the ESD rating on the device in case it was
more sensitive that I assumed. Turns out the 827 Rev A silicon is
2000V HBM (human body model) on all pins except for the ADC pins,
which are only 500V HBM. I unless it avived bad, I probably zapped
my own part.

My only other for sure experiance with knowing the ESD ratings and
how easy they are to zap is that I worked on a team that was zaping
100V HBM chips while working with straps on waxed floors with
grounded benches. While I was walking around with 2000V HBM chips in
my bare hands on carpet with out any noticable destruction. I have
also seen 300V HMB measured with an ESD meter while strapped to a
grounded bench. So I'm sure I could have easly gotten to 500V HBM at
my desk.

Sigh...

Jacob

--- In motoroladsp@y..., "Jacob" <jacob@p...> wrote:
>
> The addition of the caps to Vss on my EVM did not help the
problem. I can
> see that the Vrefp output of the chip is at 0.000V on RESET. Upon
> initalizing the ADC Vrefp jumps to 0.222V. I belive that the
problem I'm
> having is in the silicon of the chip. I can say though that the
Motorola
> and Metrowerks DSP guys (and gals) are responding marvelously,
especially
> Leonard (thanks).
>
> The 56F827 I have is marked with the following...
>
> PC56F827FG80
> Rome Rev A
> C63849.00 W#1
> 0116
>
> Jacob



Reply by Jacob November 9, 20022002-11-09

The addition of the caps to Vss on my EVM did not help the problem. I can
see that the Vrefp output of the chip is at 0.000V on RESET. Upon
initalizing the ADC Vrefp jumps to 0.222V. I belive that the problem I'm
having is in the silicon of the chip. I can say though that the Motorola
and Metrowerks DSP guys (and gals) are responding marvelously, especially
Leonard (thanks).

The 56F827 I have is marked with the following...

PC56F827FG80
Rome Rev A
C63849.00 W#1
0116

Jacob




Reply by Jacob November 8, 20022002-11-08
It appears that I have one of these older 827 boards. I saw that they were
recommended in the documentation, but I didn't expect that they would cause
the extreme errors I am seeing. I'll try this today.

Thank you very much, if it works then thank you thank you thank you!!!!

Jacob

-----Original Message-----
From: Daniel Malik [mailto:]
Sent: Thursday, November 07, 2002 11:49 PM
To: Jacob Christ
Subject: RE: [motoroladsp] Re: EVM56F827 ADC Problem... Hello Jacob,

the probability is low, but just in case: If you have one of the very early
827EVMs, 3 decoupling capacitors need to be added to the board. These need
to be connected to pins 65, 66 & 68 of the DSP (see attached photo). These
caps are required to decouple the internally generated reference voltages on
Vrefp, Vrefmid & Vrefn pins and were omitted in the initial design by
mistake.

Daniel

> -----Original Message-----
> From: Jacob Christ [mailto:]
> Sent: Thursday, November 07, 2002 10:54 PM
> To:
> Subject: [motoroladsp] Re: EVM56F827 ADC Problem... > Over the last day I have convinced my self that the proplems I am
> having with the ADC are in silicon and not software. I have tried
> both sample applications 5-24 and 5-27 (with the addition of a printf
> to show my results) in the Targeting 826/827 users manual with the
> same results (see e-mail below). I have further examamed the ADC
> control register and think it is set up correctly (or at least set up
> as documented in the 827UM). And again the Vrefp output is not
> making it to 3.3V (Vrefhi). So I have come to the conclusion that my
> problem is lies in silicon.
>
> I think there could be one of two issues with the silicon. The first
> and most likely, I zapped something. My development enviorment is no
> where near what might be considered good for ESD prevention. Second,
> and probably not likely, there is a bug in the chip. So, I would
> like to hear from ANYONE that has the ADC on an 827 working.
>
> My simple application has a pot setup as a voltage divider between
> +3.3V and ground with the wiper going to ANA0.
>
> If I can't get this to work, I'm going to endup using the crystal
> codec (teeth grinding)
>
> Jacob
>
> --- In motoroladsp@y..., "Jacob Christ" <jacob@p...> wrote:
> > Okay guys what am I doing wrong??? I been stumped on this problem
> > for about three days now. I'm using the using the SDK to read the
> > ADC of the 56F827 and I am only getting about 3 bits of
> resolution.
> > Acording to the schamatic, and my measurment on the pin, Vrefhi is
> > 3.3V and Vreflo is 0V. When the ADC is running Vrefp is 0.222V,
> > Vrefn is 0.113 and Vrefmid is 0.171V. I think this is where lies
> my
> > problem, but I'm not sure why there getting to voltage.
> >
> > The included code snipit fills the array with value the following
> > values. The lower values coraspond to lower voltage on the ADC pin.
> >
> > 0x2ee8
> > 0x3bb8
> > 0x4ee8
> > 0x4bb8
> > 0x4eb8
> > 0x5ae8
> > 0x5bb8
> >
> > Jacob
> >
> > //******************************************************************
> > // From appconfig.h
> > //******************************************************************
> > #define ADC_SAMPLING_RATE_PER_CHANNEL 2000 /* 2KHz. */
> > #define ADC_SAMPLE_0 ADC_ANALOG_CHANNEL_0
> >
> > void User_Scan_Complete_ISR(void);
> > #define ADC_USER_INTERRUPT_HANDLER User_Scan_Complete_ISR
> >
> > //******************************************************************
> > #include "port.h"
> >
> > #include "bsp.h"
> > #include "io.h"
> > #include "adc.h"
> >
> > #define ADC_DATA_SIZE 0x100
> > CFrac16 adc_data[ADC_DATA_SIZE];
> > int hold_off_x125uS = 0x50;
> >
> > int AdcFD;
> >
> > volatile int AdcIndex;
> > volatile int AdcDoneFlag;
> >
> > //******************************************************************
> > void main(void)
> > {
> > // Start sampling
> > AdcIndex = 0;
> > AdcDoneFlag = false;
> >
> > /* opens ADC device in blocking mode */
> > AdcFD = open(BSP_DEVICE_NAME_ADC_0, O_BLOCK);
> > ioctl(AdcFD, ADC_POWER_ON, NULL);
> > /* starts Timer A0 generating sync pulses */
> > ioctl(AdcFD, ADC_SYNC_ON, NULL);
> >
> > // Wait for sampling to finish by
> > // checking of the timer interrupt is on.
> > while(AdcDoneFlag == false)
> > ;
> >
> > close(AdcFD);
> >
> > }
> >
> > //******************************************************************
> > void User_Scan_Complete_ISR(void)
> > {
> > /* this will save and restore used registers */
> > #pragma interrupt
> > static int hold_off = 0;
> >
> >
> > /* store samples from sample registers 0 */
> > if( hold_off < hold_off_x125uS )
> > {
> > hold_off++;
> > }
> > else
> > {
> > // Consume sample
> > adc_data[AdcIndex++].real = \
> > ioctl(AdcFD,ADC_READ_SAMPLE_REGISTER,ADC_SAMPLE_REGISTER_0);
> > }
> >
> > if(AdcIndex == ADC_DATA_SIZE)
> > {
> > AdcIndex = 0;
> > AdcDoneFlag = true;
> > hold_off = 0;
> > ioctl(AdcFD, ADC_STOP, NULL);
> >
> > }
> >
> > /* clear "End of Scan" interrupt flag */
> > ioctl(Adc, ADC_CLEAR_END_OF_SCAN, NULL);
> > } > _____________________________________
> Note: If you do a simple "reply" with your email client, only the
> author of this message will receive your answer. You need to do
> a "reply all" if you want your answer to be distributed to the
> entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/motoroladsp
>
> More Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/
>




Reply by Jacob Christ November 7, 20022002-11-07
Over the last day I have convinced my self that the proplems I am
having with the ADC are in silicon and not software. I have tried
both sample applications 5-24 and 5-27 (with the addition of a printf
to show my results) in the Targeting 826/827 users manual with the
same results (see e-mail below). I have further examamed the ADC
control register and think it is set up correctly (or at least set up
as documented in the 827UM). And again the Vrefp output is not
making it to 3.3V (Vrefhi). So I have come to the conclusion that my
problem is lies in silicon.

I think there could be one of two issues with the silicon. The first
and most likely, I zapped something. My development enviorment is no
where near what might be considered good for ESD prevention. Second,
and probably not likely, there is a bug in the chip. So, I would
like to hear from ANYONE that has the ADC on an 827 working.

My simple application has a pot setup as a voltage divider between
+3.3V and ground with the wiper going to ANA0.

If I can't get this to work, I'm going to endup using the crystal
codec (teeth grinding)

Jacob

--- In motoroladsp@y..., "Jacob Christ" <jacob@p...> wrote:
> Okay guys what am I doing wrong??? I been stumped on this problem
> for about three days now. I'm using the using the SDK to read the
> ADC of the 56F827 and I am only getting about 3 bits of
resolution.
> Acording to the schamatic, and my measurment on the pin, Vrefhi is
> 3.3V and Vreflo is 0V. When the ADC is running Vrefp is 0.222V,
> Vrefn is 0.113 and Vrefmid is 0.171V. I think this is where lies
my
> problem, but I'm not sure why there getting to voltage.
>
> The included code snipit fills the array with value the following
> values. The lower values coraspond to lower voltage on the ADC pin.
>
> 0x2ee8
> 0x3bb8
> 0x4ee8
> 0x4bb8
> 0x4eb8
> 0x5ae8
> 0x5bb8
>
> Jacob
>
> //******************************************************************
> // From appconfig.h
> //******************************************************************
> #define ADC_SAMPLING_RATE_PER_CHANNEL 2000 /* 2KHz. */
> #define ADC_SAMPLE_0 ADC_ANALOG_CHANNEL_0
>
> void User_Scan_Complete_ISR(void);
> #define ADC_USER_INTERRUPT_HANDLER User_Scan_Complete_ISR
>
> //******************************************************************
> #include "port.h"
>
> #include "bsp.h"
> #include "io.h"
> #include "adc.h"
>
> #define ADC_DATA_SIZE 0x100
> CFrac16 adc_data[ADC_DATA_SIZE];
> int hold_off_x125uS = 0x50;
>
> int AdcFD;
>
> volatile int AdcIndex;
> volatile int AdcDoneFlag;
>
> //******************************************************************
> void main(void)
> {
> // Start sampling
> AdcIndex = 0;
> AdcDoneFlag = false;
>
> /* opens ADC device in blocking mode */
> AdcFD = open(BSP_DEVICE_NAME_ADC_0, O_BLOCK);
> ioctl(AdcFD, ADC_POWER_ON, NULL);
> /* starts Timer A0 generating sync pulses */
> ioctl(AdcFD, ADC_SYNC_ON, NULL);
>
> // Wait for sampling to finish by
> // checking of the timer interrupt is on.
> while(AdcDoneFlag == false)
> ;
>
> close(AdcFD);
>
> }
>
> //******************************************************************
> void User_Scan_Complete_ISR(void)
> {
> /* this will save and restore used registers */
> #pragma interrupt
> static int hold_off = 0; > /* store samples from sample registers 0 */
> if( hold_off < hold_off_x125uS )
> {
> hold_off++;
> }
> else
> {
> // Consume sample
> adc_data[AdcIndex++].real = \
> ioctl(AdcFD,ADC_READ_SAMPLE_REGISTER,ADC_SAMPLE_REGISTER_0);
> }
>
> if(AdcIndex == ADC_DATA_SIZE)
> {
> AdcIndex = 0;
> AdcDoneFlag = true;
> hold_off = 0;
> ioctl(AdcFD, ADC_STOP, NULL);
>
> }
>
> /* clear "End of Scan" interrupt flag */
> ioctl(Adc, ADC_CLEAR_END_OF_SCAN, NULL);
> }




Reply by Johnson, Jerry November 7, 20022002-11-07
I could not find any documentation in the DSP56F827 user manual (Rev. 1.0), nor the Data Sheet (Rev 1.0) , (nor the 82X User Manual Addendum published Oct. 14, 2002) that told me which Timer A output would generate the "Internal" ADC SYNC Signal???
 
I hope you know for sure that timer A0 output is internally connected that way!!!
It does not appear that the sync signal is brought out to an external pin either!!!
 
Jerry.
-----Original Message-----
From: Jacob Christ [mailto:j...@pontech.com]
Sent: Wednesday, November 06, 2002 1:42 PM
To: m...@yahoogroups.com
Subject: [motoroladsp] EVM56F827 ADC Problem...

Okay guys what am I doing wrong???  I been stumped on this problem
for about three days now.  I'm using the using the SDK to read the
ADC of the 56F827 and I am only getting about 3 bits of resolution. 
Acording to the schamatic, and my measurment on the pin, Vrefhi is
3.3V and Vreflo is 0V.  When the ADC is running Vrefp is 0.222V,
Vrefn is 0.113 and Vrefmid is 0.171V.  I think this is where lies my
problem, but I'm not sure why there getting to voltage.

The included code snipit fills the array with value the following
values.  The lower values coraspond to lower voltage on the ADC pin.

0x2ee8
0x3bb8
0x4ee8
0x4bb8
0x4eb8
0x5ae8
0x5bb8

Jacob

//******************************************************************
// From appconfig.h
//******************************************************************
#define ADC_SAMPLING_RATE_PER_CHANNEL  2000 /* 2KHz. */
#define ADC_SAMPLE_0                   ADC_ANALOG_CHANNEL_0

void User_Scan_Complete_ISR(void);
#define ADC_USER_INTERRUPT_HANDLER     User_Scan_Complete_ISR

//******************************************************************
#include "port.h"

#include "bsp.h"
#include "io.h"
#include "adc.h"

#define ADC_DATA_SIZE 0x100
CFrac16 adc_data[ADC_DATA_SIZE];
int hold_off_x125uS = 0x50;

int            AdcFD;

volatile int   AdcIndex;
volatile int   AdcDoneFlag;

//******************************************************************
void main(void)
{
   // Start sampling
   AdcIndex    = 0;
   AdcDoneFlag = false;

   /* opens ADC device in blocking mode */
   AdcFD = open(BSP_DEVICE_NAME_ADC_0, O_BLOCK);
   ioctl(AdcFD, ADC_POWER_ON, NULL);
   /* starts Timer A0 generating sync pulses */
   ioctl(AdcFD, ADC_SYNC_ON, NULL);

   // Wait for sampling to finish by
   // checking of the timer interrupt is on.
   while(AdcDoneFlag == false)
      ;

   close(AdcFD);

}

//******************************************************************
void User_Scan_Complete_ISR(void)
{
   /* this will save and restore used registers */
   #pragma interrupt
   static int hold_off = 0;   /* store samples from sample registers 0 */
   if( hold_off < hold_off_x125uS )
   {
      hold_off++;
   }
   else
   {
      // Consume sample
      adc_data[AdcIndex++].real = \
        ioctl(AdcFD,ADC_READ_SAMPLE_REGISTER,ADC_SAMPLE_REGISTER_0);
   }
  
   if(AdcIndex == ADC_DATA_SIZE)
   {
      AdcIndex     = 0;
      AdcDoneFlag = true;
      hold_off = 0;
      ioctl(AdcFD, ADC_STOP, NULL);

   }
  
   /* clear "End of Scan" interrupt flag */
   ioctl(Adc, ADC_CLEAR_END_OF_SCAN, NULL);
}

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3


">Yahoo! Terms of Service.


Reply by Johnson, Jerry November 6, 20022002-11-06
Ooops!  I just noticed you are using the 56F827 device?  Perhaps my comment on A) is wrong??? I use the 807!!!
 
Sorry.
 
Jerry.
-----Original Message-----
From: Jacob Christ [mailto:j...@pontech.com]
Sent: Wednesday, November 06, 2002 1:42 PM
To: m...@yahoogroups.com
Subject: [motoroladsp] EVM56F827 ADC Problem...

Okay guys what am I doing wrong???  I been stumped on this problem
for about three days now.  I'm using the using the SDK to read the
ADC of the 56F827 and I am only getting about 3 bits of resolution. 
Acording to the schamatic, and my measurment on the pin, Vrefhi is
3.3V and Vreflo is 0V.  When the ADC is running Vrefp is 0.222V,
Vrefn is 0.113 and Vrefmid is 0.171V.  I think this is where lies my
problem, but I'm not sure why there getting to voltage.

The included code snipit fills the array with value the following
values.  The lower values coraspond to lower voltage on the ADC pin.

0x2ee8
0x3bb8
0x4ee8
0x4bb8
0x4eb8
0x5ae8
0x5bb8

Jacob

//******************************************************************
// From appconfig.h
//******************************************************************
#define ADC_SAMPLING_RATE_PER_CHANNEL  2000 /* 2KHz. */
#define ADC_SAMPLE_0                   ADC_ANALOG_CHANNEL_0

void User_Scan_Complete_ISR(void);
#define ADC_USER_INTERRUPT_HANDLER     User_Scan_Complete_ISR

//******************************************************************
#include "port.h"

#include "bsp.h"
#include "io.h"
#include "adc.h"

#define ADC_DATA_SIZE 0x100
CFrac16 adc_data[ADC_DATA_SIZE];
int hold_off_x125uS = 0x50;

int            AdcFD;

volatile int   AdcIndex;
volatile int   AdcDoneFlag;

//******************************************************************
void main(void)
{
   // Start sampling
   AdcIndex    = 0;
   AdcDoneFlag = false;

   /* opens ADC device in blocking mode */
   AdcFD = open(BSP_DEVICE_NAME_ADC_0, O_BLOCK);
   ioctl(AdcFD, ADC_POWER_ON, NULL);
   /* starts Timer A0 generating sync pulses */
   ioctl(AdcFD, ADC_SYNC_ON, NULL);

   // Wait for sampling to finish by
   // checking of the timer interrupt is on.
   while(AdcDoneFlag == false)
      ;

   close(AdcFD);

}

//******************************************************************
void User_Scan_Complete_ISR(void)
{
   /* this will save and restore used registers */
   #pragma interrupt
   static int hold_off = 0;   /* store samples from sample registers 0 */
   if( hold_off < hold_off_x125uS )
   {
      hold_off++;
   }
   else
   {
      // Consume sample
      adc_data[AdcIndex++].real = \
        ioctl(AdcFD,ADC_READ_SAMPLE_REGISTER,ADC_SAMPLE_REGISTER_0);
   }
  
   if(AdcIndex == ADC_DATA_SIZE)
   {
      AdcIndex     = 0;
      AdcDoneFlag = true;
      hold_off = 0;
      ioctl(AdcFD, ADC_STOP, NULL);

   }
  
   /* clear "End of Scan" interrupt flag */
   ioctl(Adc, ADC_CLEAR_END_OF_SCAN, NULL);
}

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3


">Yahoo! Terms of Service.


Reply by Johnson, Jerry November 6, 20022002-11-06
My first impression, generates 2 issues:
 
    Where is the ADC_START ioctl call done?
    If you are actually trying to use the ADC_SYNC functionality, The SYNC signal can only be generated from the BSP_DEVICE_NAME_QUAD_TIMER_C_2 device?  You cannot generate a SYNC signal from the A0 timer.
 
 
Jerry.
 
 
-----Original Message-----
From: Jacob Christ [mailto:j...@pontech.com]
Sent: Wednesday, November 06, 2002 1:42 PM
To: m...@yahoogroups.com
Subject: [motoroladsp] EVM56F827 ADC Problem...

Okay guys what am I doing wrong???  I been stumped on this problem
for about three days now.  I'm using the using the SDK to read the
ADC of the 56F827 and I am only getting about 3 bits of resolution. 
Acording to the schamatic, and my measurment on the pin, Vrefhi is
3.3V and Vreflo is 0V.  When the ADC is running Vrefp is 0.222V,
Vrefn is 0.113 and Vrefmid is 0.171V.  I think this is where lies my
problem, but I'm not sure why there getting to voltage.

The included code snipit fills the array with value the following
values.  The lower values coraspond to lower voltage on the ADC pin.

0x2ee8
0x3bb8
0x4ee8
0x4bb8
0x4eb8
0x5ae8
0x5bb8

Jacob

//******************************************************************
// From appconfig.h
//******************************************************************
#define ADC_SAMPLING_RATE_PER_CHANNEL  2000 /* 2KHz. */
#define ADC_SAMPLE_0                   ADC_ANALOG_CHANNEL_0

void User_Scan_Complete_ISR(void);
#define ADC_USER_INTERRUPT_HANDLER     User_Scan_Complete_ISR

//******************************************************************
#include "port.h"

#include "bsp.h"
#include "io.h"
#include "adc.h"

#define ADC_DATA_SIZE 0x100
CFrac16 adc_data[ADC_DATA_SIZE];
int hold_off_x125uS = 0x50;

int            AdcFD;

volatile int   AdcIndex;
volatile int   AdcDoneFlag;

//******************************************************************
void main(void)
{
   // Start sampling
   AdcIndex    = 0;
   AdcDoneFlag = false;

   /* opens ADC device in blocking mode */
   AdcFD = open(BSP_DEVICE_NAME_ADC_0, O_BLOCK);
   ioctl(AdcFD, ADC_POWER_ON, NULL);
   /* starts Timer A0 generating sync pulses */
   ioctl(AdcFD, ADC_SYNC_ON, NULL);

   // Wait for sampling to finish by
   // checking of the timer interrupt is on.
   while(AdcDoneFlag == false)
      ;

   close(AdcFD);

}

//******************************************************************
void User_Scan_Complete_ISR(void)
{
   /* this will save and restore used registers */
   #pragma interrupt
   static int hold_off = 0;   /* store samples from sample registers 0 */
   if( hold_off < hold_off_x125uS )
   {
      hold_off++;
   }
   else
   {
      // Consume sample
      adc_data[AdcIndex++].real = \
        ioctl(AdcFD,ADC_READ_SAMPLE_REGISTER,ADC_SAMPLE_REGISTER_0);
   }
  
   if(AdcIndex == ADC_DATA_SIZE)
   {
      AdcIndex     = 0;
      AdcDoneFlag = true;
      hold_off = 0;
      ioctl(AdcFD, ADC_STOP, NULL);

   }
  
   /* clear "End of Scan" interrupt flag */
   ioctl(Adc, ADC_CLEAR_END_OF_SCAN, NULL);
}

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3


">Yahoo! Terms of Service.


Reply by Jacob Christ November 6, 20022002-11-06
Okay guys what am I doing wrong??? I been stumped on this problem
for about three days now. I'm using the using the SDK to read the
ADC of the 56F827 and I am only getting about 3 bits of resolution.
Acording to the schamatic, and my measurment on the pin, Vrefhi is
3.3V and Vreflo is 0V. When the ADC is running Vrefp is 0.222V,
Vrefn is 0.113 and Vrefmid is 0.171V. I think this is where lies my
problem, but I'm not sure why there getting to voltage.

The included code snipit fills the array with value the following
values. The lower values coraspond to lower voltage on the ADC pin.

0x2ee8
0x3bb8
0x4ee8
0x4bb8
0x4eb8
0x5ae8
0x5bb8

Jacob

//******************************************************************
// From appconfig.h
//******************************************************************
#define ADC_SAMPLING_RATE_PER_CHANNEL 2000 /* 2KHz. */
#define ADC_SAMPLE_0 ADC_ANALOG_CHANNEL_0

void User_Scan_Complete_ISR(void);
#define ADC_USER_INTERRUPT_HANDLER User_Scan_Complete_ISR

//******************************************************************
#include "port.h"

#include "bsp.h"
#include "io.h"
#include "adc.h"

#define ADC_DATA_SIZE 0x100
CFrac16 adc_data[ADC_DATA_SIZE];
int hold_off_x125uS = 0x50;

int AdcFD;

volatile int AdcIndex;
volatile int AdcDoneFlag;

//******************************************************************
void main(void)
{
// Start sampling
AdcIndex = 0;
AdcDoneFlag = false;

/* opens ADC device in blocking mode */
AdcFD = open(BSP_DEVICE_NAME_ADC_0, O_BLOCK);
ioctl(AdcFD, ADC_POWER_ON, NULL);
/* starts Timer A0 generating sync pulses */
ioctl(AdcFD, ADC_SYNC_ON, NULL);

// Wait for sampling to finish by
// checking of the timer interrupt is on.
while(AdcDoneFlag == false)
;

close(AdcFD);

}

//******************************************************************
void User_Scan_Complete_ISR(void)
{
/* this will save and restore used registers */
#pragma interrupt
static int hold_off = 0; /* store samples from sample registers 0 */
if( hold_off < hold_off_x125uS )
{
hold_off++;
}
else
{
// Consume sample
adc_data[AdcIndex++].real = \
ioctl(AdcFD,ADC_READ_SAMPLE_REGISTER,ADC_SAMPLE_REGISTER_0);
}

if(AdcIndex == ADC_DATA_SIZE)
{
AdcIndex = 0;
AdcDoneFlag = true;
hold_off = 0;
ioctl(AdcFD, ADC_STOP, NULL);

}

/* clear "End of Scan" interrupt flag */
ioctl(Adc, ADC_CLEAR_END_OF_SCAN, NULL);
}