A/D Driver

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

I'm working with the atxmega256a3u device (well, really the atmega inside of ATZB-X0-256-3-0-C).

I'm using the Atmel Studio 6.2 beta

I've created a small A/D test program to measure the battery voltage and works. This program was defined by specifying a user board with the correct atxmega device. When I used the ASF Wizard to pull in the A/D driver, everything worked perfect.

So now I want to incorporate this test program into a program using the Lightweight mesh for RF stuff.

Now, when I use the ASF Wizard to pull in the A/D service, It seems to work ok - however, it is not the same one that is used in my test program. In fact, it has undeclared components in it that I can not resolve causing compiler errors. (These are not in the A/D driver from my test program)

Here are the undeclared items:

ADC_REFSEL_VCC_gc
ADC_REFSEL_VCCDIV2_gc

I'm assuming I have one of my symbols messed up, but they look ok to me.

BOARD-USER_BOARD
IOPORT_XMEGA_COMPAT

and a few needed for the light weight mesh.

Does anyone know how the asf wizard gets it's header files from or how to control which version of the code gets pulled in?

thx

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

I was also facing the same problem but when I looked at the definition files, I realized that we should change,

ADC_REFSEL_VCC_gc -> ADC_REFSEL_INTVCC_gc
ADC_REFSEL_VCCDIV2_gc -> ADC_REFSEL_INTVCC2_gc

I hope this solves your problem.

BR / Yasir Qureshi

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

Hmh, this bug is not listed in the fixed list for the toolchain. I'll have to look into that...

DEVXML-408 wrote:

Rename ADC_REFSEL_VCC_gc to ADC_REFSEL_INTVCC_gc for XMEGA A, B, C and D to comply with datasheet.

Hope that clears the confusion...

The change was requested to make the field comply with the datasheet name. This has been done for IAR and avr8-gcc (Atmel release, not yet upstreamed to public avr-libc)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.