• AVR Freaks

Hot!Missing Assembler file, Studio 7

Author
Gilbert Gagne
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/10/04 10:00:28
  • Location: 0
  • Status: offline
2019/10/04 13:11:26 (permalink)
0

Missing Assembler file, Studio 7

I'm a newbie on Atmel Studio 7 trying to get ATtiny104 Xplained Nano up and running. Started new Assembler project and clicked device ATtiny104. Wrote some code but BUILD tags all named registers as "Invalid register". My project seems to be missing a startup file with names and addresses of ATtiny104 registers such as PINA, DDRA, etc.
#1

3 Replies Related Threads

    charlie0
    Starting Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2018/04/30 11:46:04
    • Location: 0
    • Status: offline
    Re: Missing Assembler file, Studio 7 2019/10/09 11:22:52 (permalink)
    +1 (1)
    Hi Gilbert,
     
    Just for future reference, https://www.avrfreaks.net/ is generally the forum you want to go to for AVR questions.
     
    Did you make sure to include the register definition file like so?
     

    #include "tn104def.inc"  ; make sure to include register definitions
    start:
         inc r16
         rjmp start
         out PORTA, r16
     

     
    Just in case that's not it, do you have a small code snippet that shows the build errors? 
     
    #2
    Gilbert Gagne
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/10/04 10:00:28
    • Location: 0
    • Status: offline
    Re: Missing Assembler file, Studio 7 2019/10/09 13:59:00 (permalink)
    0
    Hi Charlie0
     
    I included   #include "tn104def.inc"   in main.asm and also included it in the same directory as main.asm.
    This line, as well as all lines with register names, produces Build error "Invalid register".
    ; setuP timer;
    ldi r16, 0x81 ;sync timer & reset prescaler
    mov GTCCR, r16 ;hold timer during config, TSM & PSR
     
    tn104def.inc is listed in the Solution Explorer box under Dependencies.
     
    Also, how to get line numbers to appear in my assembly listing?
     
     
     
    #3
    charlie0
    Starting Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2018/04/30 11:46:04
    • Location: 0
    • Status: offline
    Re: Missing Assembler file, Studio 7 2019/10/09 14:52:01 (permalink)
    +1 (1)
    On the AVR devices, the peripheral registers such as PORTA and GTCCR can only be operated on using I/O specific instructions.  In the case of the ATtiny104 these would include the instructions: out, in, sbic, sbis, sbi, and cbi.  I'm guessing that could be the reason for the build errors in your code.  You might try this to replace your previous piece of code, for example:
     

    ldi r16, 0x81
    out GTCCR, r16

     
    To display the line numbers, there should be an option under tools -> options -> text editor.
     
    I hope this helps.
     
    #4
    Jump to:
    © 2020 APG vNext Commercial Version 4.5