Menu

why does not the "aa" value increase in the tiny10 circuit?

Help
2017-12-07
2018-07-01
  • Sampsa Lahtinen

    Sampsa Lahtinen - 2017-12-07
    #chip tiny10, 1
    
    dim aa as Byte
    
    dir portb.0 out
    
    
    
    do
    
    aa=aa+1
    
     if aa > 100 then
        portb.0=1
        end
     end if
    
    Loop
    
     

    Last edit: Anobium 2017-12-08
  • kent_twt4

    kent_twt4 - 2017-12-08

    There is a superfluous "end" that should be deleted.

    Also, use the "else" condition to turn off the portb.0, if the excersise is to blink an led? For code tags tap the code</> in the menu and paste code to preserve formatting.:

    do
      If aa > 100
        portb.0 = 1
      else
        portb.0 = 0
      end if
      wait 1 ms
    loop
    
     
  • Moto Geek

    Moto Geek - 2017-12-08

    need some aa = aa +1 action in that do loop...

     
  • Anobium

    Anobium - 2017-12-08

    @Sampsa - welcome

    MotoGeek and Kent are spot on you logic is not going to do very much but they give great advice.

     
  • Sampsa Lahtinen

    Sampsa Lahtinen - 2018-07-01

    Oukei.
    The problem seems to be compiler (ver.0.98.02) with attiny10 ic. The compiler uses r0 for the variable aa in the example. I think it should go to r16 place? Could developers check this?

     
    • Anobium

      Anobium - 2018-07-01

      Post the source code please. It may be the same as the initial posting in 2017 but it may not be, please post.

       
    • Anobium

      Anobium - 2018-07-01

      Post the source code please. It may be the same as the initial posting in 2017 but it may not be, please post.

       
  • Sampsa Lahtinen

    Sampsa Lahtinen - 2018-07-01

    chip tiny10, 1

    dim a1 as Byte

    dir portb.0 out

    do

    a1=a1+1

    if a1>3 Then
    ' portb.0=1
    goto loppu
    end if

    portb.0 = 1
    wait 500 ms
    portb.0 = 0
    wait 500 ms

    Loop

    loppu:
    End

    i test asm with AVR studio5 and compiler say "invalid register .DEF SYSTEMP1=r0"
    LED flashes but does not stop after three steps?

    Error 5 Invalid register C:\Users\Sampsa paja\Documents\AVRStudio 5.1\AVRAssembler1\AVRAssembler1\AVRAssembler1.asm 36 0 AVRAssembler1

     
  • kent_twt4

    kent_twt4 - 2018-07-01

    Known issue with core = AVR8L_0 devices (i.e. ATtiny4, 5, 9, 10, 20, 40, 102, 104).

    I have dropped the ball on providing Anobium with clean .dat files for this AVRseries. I believe I have a tool driven .dat generator (April 2018) for the ATtiny10, and separately have parsed the maxmhz and pins for Sot23 device. They have not yet been merged to a single tool, single .dat generator, need to do that :-)

     

Log in to post a comment.

MongoDB Logo MongoDB