Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

help

help

2008-02-14 by Tom

I am confounded and flummoxed.   I  have an assembly program I am 
attempting to build in AVRStudio, but the assembler is ignoring my 
code.   I don't get it. I have compared it to other code I have which 
assembles just fine, and can find no difference which explains this 
behaviour.  The editor is highlighting syntax appropriately, so I am lost:


.include        "tn25def.inc"

;
;    interrupt table
;

.org    0                                                ; starting address

START:
INT0:            rjmp    DUMMY            ; external Interrupt 0
PCIO:            rjmp    DUMMY            ; pin change interrupt 0
OC1A:           rjmp    DUMMY            ; timer/counter 1 mompare match 1A
OVF1:           rjmp    DUMMY            ; timer/counter 1 overflow
OVF0:           rjmp    DUMMY            ; timer/counter 0 overflow
ERDY:          rjmp    DUMMY            ; EEPROM ready interrupt
ACI:              rjmp    DUMMY            ; Analog comparator interrupt
ADCC:          rjmp    DUMMY            ; ADC conversion ready interrupt
OC1B:           rjmp    DUMMY            ; timer/counter 1 compare match B
OC0A:           rjmp    DUMMY            ; timer/counter 0 ocmpare match A
OC0B:           rjmp    DUMMY            ; timer/counter 0 compare match B
WDT:            rjmp    DUMMY            ; watchdog timer interrupt
USI_START: rjmp    DUMMY            ; USI start interrupt
USI_OVF:      rjmp    DUMMY            ; USI overflow interrupt

;
;    end interrupt table
;

;
;    constant defintions
;

.equ    TRUE     =    0xff
.equ    FALSE    =    !TRUE
.equ    DIV         =    0x28                ; divisor for timer readings

START:

ldi        SPL,    SRAM_START        ; load stack pointer


   SO, what am I doing wrong?  Assembler says the source file is empty (??)


avrFrfeak

Re: [AVR-Chat] help

2008-02-14 by David VanHorn

On Thu, Feb 14, 2008 at 5:11 PM, Tom <tjkeller1@windstream.net> wrote:
> I am confounded and flummoxed.   I  have an assembly program I am
> attempting to build in AVRStudio, but the assembler is ignoring my
> code.   I don't get it. I have compared it to other code I have which
> assembles just fine, and can find no difference which explains this
> behaviour.  The editor is highlighting syntax appropriately, so I am lost:


Well, at the moment, I'm fighting studio problems that are about that
low level..

After the usual stuff:

Here:
ldi temp,$FF
ldi temp,$FE
rjmp here

temp remains at whatever value it was, and the rjmp dosen't work.
support is baffled, I am baffled and confused.



For your problem:

Check the data sheet on the vector table, wether it uses jmp or rjmp.
I'm almost sure it's rjmp, but I've been bitten there too.

Check that the simulator is working in the same device, it dosen't
automatically get that from the code.

Re: [AVR-Chat] help

2008-02-14 by David VanHorn

Also, I didn't see a .dseg, but you might not need one.

Re: [AVR-Chat] help

2008-02-14 by James Wagner

There are two START labels!

Jim

On Feb 14, 2008, at 2:11 PM, Tom wrote:

> I am confounded and flummoxed. I have an assembly program I am
> attempting to build in AVRStudio, but the assembler is ignoring my
> code. I don't get it. I have compared it to other code I have which
> assembles just fine, and can find no difference which explains this
> behaviour. The editor is highlighting syntax appropriately, so I am  
> lost:
>
> include "tn25def.inc"
>
> ;
> ; interrupt table
> ;
>
> org 0 ; starting address
>
> START:
> INT0: rjmp DUMMY ; external Interrupt 0
> PCIO: rjmp DUMMY ; pin change interrupt 0
> OC1A: rjmp DUMMY ; timer/counter 1 mompare match 1A
> OVF1: rjmp DUMMY ; timer/counter 1 overflow
> OVF0: rjmp DUMMY ; timer/counter 0 overflow
> ERDY: rjmp DUMMY ; EEPROM ready interrupt
> ACI: rjmp DUMMY ; Analog comparator interrupt
> ADCC: rjmp DUMMY ; ADC conversion ready interrupt
> OC1B: rjmp DUMMY ; timer/counter 1 compare match B
> OC0A: rjmp DUMMY ; timer/counter 0 ocmpare match A
> OC0B: rjmp DUMMY ; timer/counter 0 compare match B
> WDT: rjmp DUMMY ; watchdog timer interrupt
> USI_START: rjmp DUMMY ; USI start interrupt
> USI_OVF: rjmp DUMMY ; USI overflow interrupt
>
> ;
> ; end interrupt table
> ;
>
> ;
> ; constant defintions
> ;
>
> equ TRUE = 0xff
> equ FALSE = !TRUE
> equ DIV = 0x28 ; divisor for timer readings
>
> START:
>
> ldi SPL, SRAM_START ; load stack pointer
>
> SO, what am I doing wrong? Assembler says the source file is empty  
> (??)
>
> avrFrfeak
>
> 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] help

2008-02-14 by David VanHorn

Indeed there are, the asm should have caught that.
Also, the reset int vector should be on top of the list, with "rjmp start"

So it would look like this:

reset:  rjmp Start

(rest of int vector table etc)


Start:
   Init code goes here

Main
   App code goes here
   rjmp main
Show quoted textHide quoted text
On Thu, Feb 14, 2008 at 5:26 PM, James Wagner <wagnerj@proaxis.com> wrote:
> There are two START labels!
>
> Jim
>
>
> On Feb 14, 2008, at 2:11 PM, Tom wrote:
>
> > I am confounded and flummoxed. I have an assembly program I am
> > attempting to build in AVRStudio, but the assembler is ignoring my
> > code. I don't get it. I have compared it to other code I have which
> > assembles just fine, and can find no difference which explains this
> > behaviour. The editor is highlighting syntax appropriately, so I am
> > lost:
> >
> > include "tn25def.inc"
> >
> > ;
> > ; interrupt table
> > ;
> >
> > org 0 ; starting address
> >
> > START:
> > INT0: rjmp DUMMY ; external Interrupt 0
> > PCIO: rjmp DUMMY ; pin change interrupt 0
> > OC1A: rjmp DUMMY ; timer/counter 1 mompare match 1A
> > OVF1: rjmp DUMMY ; timer/counter 1 overflow
> > OVF0: rjmp DUMMY ; timer/counter 0 overflow
> > ERDY: rjmp DUMMY ; EEPROM ready interrupt
> > ACI: rjmp DUMMY ; Analog comparator interrupt
> > ADCC: rjmp DUMMY ; ADC conversion ready interrupt
> > OC1B: rjmp DUMMY ; timer/counter 1 compare match B
> > OC0A: rjmp DUMMY ; timer/counter 0 ocmpare match A
> > OC0B: rjmp DUMMY ; timer/counter 0 compare match B
> > WDT: rjmp DUMMY ; watchdog timer interrupt
> > USI_START: rjmp DUMMY ; USI start interrupt
> > USI_OVF: rjmp DUMMY ; USI overflow interrupt
> >
> > ;
> > ; end interrupt table
> > ;
> >
> > ;
> > ; constant defintions
> > ;
> >
> > equ TRUE = 0xff
> > equ FALSE = !TRUE
> > equ DIV = 0x28 ; divisor for timer readings
> >
> > START:
> >
> > ldi SPL, SRAM_START ; load stack pointer
> >
> > SO, what am I doing wrong? Assembler says the source file is empty
> > (??)
> >
> > avrFrfeak
> >
> >
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>

Re: [AVR-Chat] help

2008-02-14 by John Samperi

At 09:26 AM 15/02/2008, you wrote:
>There are two START labels!
>
> > START:
> >
> > ldi SPL, SRAM_START ; load stack pointer

Not to mention that the program will crash the first time you use
the stack. Try using ramend.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] help

2008-02-15 by Tom

Jim:     Yes, I forgot to mention that.   I did that deliberately.   The 
assembler is NOT noticing that!

avrFreak

James Wagner wrote:
Show quoted textHide quoted text
>
> There are two START labels!
>
> Jim
>
> On Feb 14, 2008, at 2:11 PM, Tom wrote:
>
> > I am confounded and flummoxed. I have an assembly program I am
> > attempting to build in AVRStudio, but the assembler is ignoring my
> > code. I don't get it. I have compared it to other code I have which
> > assembles just fine, and can find no difference which explains this
> > behaviour. The editor is highlighting syntax appropriately, so I am
> > lost:
> >
> > include "tn25def.inc"
> >
> > ;
> > ; interrupt table
> > ;
> >
> > org 0 ; starting address
> >
> > START:
> > INT0: rjmp DUMMY ; external Interrupt 0
> > PCIO: rjmp DUMMY ; pin change interrupt 0
> > OC1A: rjmp DUMMY ; timer/counter 1 mompare match 1A
> > OVF1: rjmp DUMMY ; timer/counter 1 overflow
> > OVF0: rjmp DUMMY ; timer/counter 0 overflow
> > ERDY: rjmp DUMMY ; EEPROM ready interrupt
> > ACI: rjmp DUMMY ; Analog comparator interrupt
> > ADCC: rjmp DUMMY ; ADC conversion ready interrupt
> > OC1B: rjmp DUMMY ; timer/counter 1 compare match B
> > OC0A: rjmp DUMMY ; timer/counter 0 ocmpare match A
> > OC0B: rjmp DUMMY ; timer/counter 0 compare match B
> > WDT: rjmp DUMMY ; watchdog timer interrupt
> > USI_START: rjmp DUMMY ; USI start interrupt
> > USI_OVF: rjmp DUMMY ; USI overflow interrupt
> >
> > ;
> > ; end interrupt table
> > ;
> >
> > ;
> > ; constant defintions
> > ;
> >
> > equ TRUE = 0xff
> > equ FALSE = !TRUE
> > equ DIV = 0x28 ; divisor for timer readings
> >
> > START:
> >
> > ldi SPL, SRAM_START ; load stack pointer
> >
> > SO, what am I doing wrong? Assembler says the source file is empty
> > (??)
> >
>

Re: [AVR-Chat] help

2008-02-15 by James Wagner

But, if you DON'T do that, is your code recognized?

Jim
On Feb 15, 2008, at 4:35 AM, Tom wrote:

> Jim: Yes, I forgot to mention that. I did that deliberately. The
> assembler is NOT noticing that!
>
> avrFreak
>
> James Wagner wrote:
> >
> > There are two START labels!
> >
> > Jim
> >
> > On Feb 14, 2008, at 2:11 PM, Tom wrote:
> >
> > > I am confounded and flummoxed. I have an assembly program I am
> > > attempting to build in AVRStudio, but the assembler is ignoring my
> > > code. I don't get it. I have compared it to other code I have  
> which
> > > assembles just fine, and can find no difference which explains  
> this
> > > behaviour. The editor is highlighting syntax appropriately, so I  
> am
> > > lost:
> > >
> > > include "tn25def.inc"
> > >
> > > ;
> > > ; interrupt table
> > > ;
> > >
> > > org 0 ; starting address
> > >
> > > START:
> > > INT0: rjmp DUMMY ; external Interrupt 0
> > > PCIO: rjmp DUMMY ; pin change interrupt 0
> > > OC1A: rjmp DUMMY ; timer/counter 1 mompare match 1A
> > > OVF1: rjmp DUMMY ; timer/counter 1 overflow
> > > OVF0: rjmp DUMMY ; timer/counter 0 overflow
> > > ERDY: rjmp DUMMY ; EEPROM ready interrupt
> > > ACI: rjmp DUMMY ; Analog comparator interrupt
> > > ADCC: rjmp DUMMY ; ADC conversion ready interrupt
> > > OC1B: rjmp DUMMY ; timer/counter 1 compare match B
> > > OC0A: rjmp DUMMY ; timer/counter 0 ocmpare match A
> > > OC0B: rjmp DUMMY ; timer/counter 0 compare match B
> > > WDT: rjmp DUMMY ; watchdog timer interrupt
> > > USI_START: rjmp DUMMY ; USI start interrupt
> > > USI_OVF: rjmp DUMMY ; USI overflow interrupt
> > >
> > > ;
> > > ; end interrupt table
> > > ;
> > >
> > > ;
> > > ; constant defintions
> > > ;
> > >
> > > equ TRUE = 0xff
> > > equ FALSE = !TRUE
> > > equ DIV = 0x28 ; divisor for timer readings
> > >
> > > START:
> > >
> > > ldi SPL, SRAM_START ; load stack pointer
> > >
> > > SO, what am I doing wrong? Assembler says the source file is empty
> > > (??)
> > >
> >
>
>
> 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] help

2008-02-16 by Tom

James Wagner wrote:
>
> But, if you DON'T do that, is your code recognized?
>
> Jim
>
no

Re: help

2008-02-25 by avrx123456789

1. Have you checked that the assembler is looking for the file that
you are looking at ?
A misspelling in a make file could have this effect.

2. Have you checked, both in your code, and in your include file, for
non-printable characters that could be confusing the assembler, but
are handled by the editor ?  One way to do that is to start with a new
file and type in the code from the old file (NOT copy-and-paste), and
see what happens....

Good Luck !


--- In AVR-Chat@yahoogroups.com, Tom <tjkeller1@...> wrote:
>
> I am confounded and flummoxed. 
<snip>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.