Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SAM3U External A/D Trigger Problem

Status
Not open for further replies.

rhaynes

Member level 5
Joined
Feb 8, 2011
Messages
84
Helped
37
Reputation
74
Reaction score
37
Trophy points
1,298
Location
Oceanside, CA, USA
Activity points
1,996
Have a question about the Atmel SAM3U series microprocessor specifically the SAM3U4C.

We are trying to use the 12-bit Analog-to-Digital converter (ADC12B) with an external hardware trigger on the AD12BTRG pin (PA2).

With ADC channel 2 enabled (also tried different combinations of enabled channels) the ADC conversion can be manually triggered by writting a 1 to the START bit in the ADC12B_CR register. The ADC then takes a measurement, puts the result in the correct Channel Data Register and we can see the value. However, the ADC never takes a measurement based on a 10Hz external hardware trigger.

ADC12B Mode Register appears to be set correctly. The hardware trigger is enabled (TRGEN=1) and trigger selection is set to external trigger (TRGSEL=0).

The external trigger pin IS being toggled. Using the debugger, the PA2 pin (AD12BTRG) can be seen going high and low. To further test that the external trigger pin is being driven correctly, Counter Timer 0 (TC0) was enabled and set it to external clock which shares same pin as AD12BTRG. Using the debugger, the counter value can be seen counting up at the right rate.

The ADC registers are set as follows:
ADC12B_CR = 0x00000000
ADC12B_MR = 0x06050801
ADC12B_SR = 0x000C0000
ADC12B_CHSR = 0x00000004 (channel 2)
The rest are 0.

We are using the IAR compiler. specifically the AT91LIB functions (ADC12_Initialize, ADC12_CfgAnalogCtrlReg, ADC12_EnableChannel) to enable and configure the ADC.

Why is the external hardware trigger not triggering the ADC converter? Is there something else that needs to be configured?

If someone has some working code that uses the ADC external trigger, that would be most helpful.

Thanks,
Ray
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top