Page 1 of 1

Issue with DACC, not able to use full output range 0 to 3.3v

Posted: Mon Jun 02, 2014 8:18 am
by priyanshu
I am using SAM4E-EK kit which is having SAM4E16E controller and I am trying to generate a square wave of 0 to 3.3v amplitude but I am getting square wave output from DACC channel in the range of 400mv to 2.8v. I think there is something wrong in initializing procedure.
Is there any way to extend the range to 0 to 3.3v ???

//_____________________________________
#define DACC_CHANNEL 1 // (PB14)
#define DACC_ANALOG_CONTROL (DACC_ACR_IBCTLCH0(0x02) \
| DACC_ACR_IBCTLCH1(0x02) \
| DACC_ACR_IBCTLDACCORE(0x01))

void gen_square(void)
{
sysclk_enable_peripheral_clock(ID_DACC);
dacc_reset(DACC);
dacc_set_transfer_mode(DACC, 0);
dacc_set_power_save(DACC, 0, 0);
dacc_set_timing(DACC, 0x08, 0, 0x10);

dacc_set_channel_selection(DACC, DACC_CHANNEL);

dacc_enable_channel(DACC, DACC_CHANNEL);

dacc_set_analog_control(DACC, DACC_ANALOG_CONTROL);

while (1)
{
dacc_write_conversion_data(DACC, 4095);
delay_ms(1);
dacc_write_conversion_data(DACC, 0);
delay_ms(1);
}
}
//_____________________________________

Re: Issue with DACC, not able to use full output range 0 to

Posted: Tue Aug 05, 2014 12:40 am
by joshuajk
I do not think you can get the full range. In the SAM4E Series manual on page 1450, in table 47-52 Analog outputs, it states that the min is Vref/6 and the max is Vref*5/6. If you for anyone else find a way to get full range can you post, as I would be interested in this as well.

Thanks.

Re: Issue with DACC, not able to use full output range 0 to

Posted: Fri May 20, 2016 10:43 am
by rayher
joshuajk wrote:I do not think you can get the full range. In the SAM4E Series manual on page 1450, in table 47-52 Analog outputs, it states that the min is Vref/6 and the max is Vref*5/6. If you for anyone else find a way to get full range can you post, as I would be interested in this as well.

Thanks.
thank for your information.

It wasted me one day to find out this answer. I am using a SAM4S DACC to drive analog waveform, it indeed swing within 1/6 ADVREF ~ 5/6 ADVREF.

I think this DAC design is 20 years old. :oops: