Why this assembly error? (AVRstudio)

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

Why does AVRstudio not recognize the bitname DAOE (Bit 1 "“ DAOE: Digital to Analog Output Enable bit) while no error on the DAEN bitname (Bit 0 "“ DAEN: Digital to Analog Enable bit). (device=AT90PWM3)

Attachment(s): 

RES

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

because it is not defined in the include file ..

; DACON - DAC Control Register
.equ	DAEN	= 0	; DAC Enable Bit
.equ	DALA	= 2	; DAC Left Adjust
.equ	DATS0	= 4	; DAC Trigger Selection Bit 0
.equ	DATS1	= 5	; DAC Trigger Selection Bit 1
.equ	DATS2	= 6	; DAC Trigger Selection Bit 2
.equ	DAATE	= 7	; DAC Auto Trigger Enable Bit

Although it does exist according to the at90pwm3 datasheet, as the function you mentioned (bit1 DAOE: Digital to Analog Output Enable bit)

Maybe someone else here knows why it isn't defined ..

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it"

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

The fault starts here (AT90PWM3.xml):

      
        NA
        $AA
        0x01
        0x04
        0x10
        0x20
        0x40
        0x80
      

and here:

      
        DACON
        DAC Control Register
        
        NA
        $AA
        io_analo.bmp
        Y
        
          DAATE
          DAC Auto Trigger Enable Bit
          
          RW
          0
        
        
          DATS2
          DAC Trigger Selection Bit 2
          
          RW
          0
        
        
          DATS1
          DAC Trigger Selection Bit 1
          
          RW
          0
        
        
          DATS0
          DAC Trigger Selection Bit 0
          
          RW
          ANALIG_DAC_AUTO_TRIGGER
          0
        
        
          DALA
          DAC Left Adjust
          
          RW
          0
        
        
          DAEN
          DAC Enable Bit
          
          RW
          0
        
      

(moving this to Studio 4 forum)

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

Yes, there are bitnames missing in the include file pwm3def.inc.
I've added the bitname and now it assembles without errors even while it is missing in the AT90PWM3.xml file.

AVRASM: AVR macro assembler 2.1.42 (build 1796 Sep 15 2009 10:48:36)
Copyright (C) 1995-2009 ATMEL Corporation

C:\Temp\2sines\2sines.asm(47): Including file 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\pwm3def.inc'
C:\Temp\2sines\2sines.asm(470): No EEPROM data, deleting C:\Temp\2sines\2sines.eep

AT90PWM3 memory use summary [bytes]:
Segment Begin End Code Data Used Size Use%
---------------------------------------------------------------
[.cseg] 0x000000 0x0010c8 168 4096 4264 8192 52.1%
[.dseg] 0x000100 0x000100 0 0 0 512 0.0%
[.eseg] 0x000000 0x000000 0 0 0 512 0.0%

Assembly complete, 0 errors. 0 warnings

RES