Configuring Output pin to check output at MIXED SIGNAL OSCILLOSCOPE in ATMEL SAME70-XPLD BOARD

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello everyone below attached is my ADC code for ATSAME70-XPLD development board. Now I am able to check the output on serial monitor but I also want to check the output on MIXED signal oscilloscope. But I am facing problem in defining the pin for output that how to connect my adc output to a pin which can be used to check output on Oscilloscope??? ITS URGENT PLS REPLY ASAP

 

#include "board.h"
#include <stdbool.h>
#include <stdio.h>
#include "afec.h"

#define IRQ_PRIOR_PIO 0
#define TEST_CHANNEL 0
#define AFE_CLK 10000000
#define CHANNEL_OFFSET 0X200

static void afe_initialization(void)
{
    AFEC_Initialize( AFEC0,ID_AFEC0 );
    
    /* AFEC MODE REGISTER CONFIGURATION */
    AFEC_SetModeReg(AFEC0,AFEC_MR_FREERUN_OFF|AFEC_MR_TRANSFER(1)|AFEC_MR_TRACKTIM(2)| AFEC_MR_ONE| AFEC_MR_STARTUP_SUT64);

    /* Set AFEC clock */
    AFEC_SetClock(AFEC0, AFE_CLK, BOARD_MCK);

    /* Select the channel */
    AFEC_EnableChannel(AFEC0, TEST_CHANNEL);

    /* Adjusting the channel level offset */
    AFEC_SetAnalogOffset(AFEC0,TEST_CHANNEL,CHANNEL_OFFSET);

    /* Enable the PGA0 and PGA 1 by tuning the AFE Bias Current Control */
    AFEC_SetAnalogControl(AFEC0, AFEC_ACR_IBCTL(1) | AFEC_ACR_PGA0_ON | AFEC_ACR_PGA1_ON);

    /* Configuring the Extended Mode Register */
    AFEC_SetExtModeReg(AFEC0,0| AFEC_EMR_RES(256)| AFEC_EMR_TAG | AFEC_EMR_STM );
}

extern int main( void )
{

    /* Disable watchdog */
    WDT_Disable(WDT);
    afe_initialization();
    AFEC_StartConversion(AFEC0);
    while (!(AFEC_GetStatus(AFEC0) & AFEC_ISR_EOC0));

    char ch =  (AFEC_GetLastConvertedData(AFEC0) & AFEC_LCDR_CHNB_Msk ) >> AFEC_LCDR_CHNB_Pos;
    float voltage = ((AFEC_GetLastConvertedData(AFEC0) & AFEC_LCDR_LDATA_Msk)) * 3254/ 4096;
    printf("%02u %04u\n\r" ,(unsigned int)ch,(unsigned int)voltage);
    
}

avantika

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But I am facing problem in defining the pin for output 

Output of what? In what format do you need the output?

/Lars

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

output of adc in form of digitized data. So that I can verify my analog signal is getting converted properly or not

avantika

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avans26 wrote:
So that I can verify my analog signal is getting converted properly or not

Don't you know that from the printf?

Anyway we still don't know what the output signal should be, I'm guessing something serial since you intend to use a single pin.

/Lars