Yahoo Groups archive

AVR-Chat

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

Thread

Why is it so!

Why is it so!

2005-03-19 by John Samperi

G'day

We I finally got my updated board with the M64 on
Friday. Put it together and got it running with some
simple code, USART0 and USART1 talking to 2 terminals
and the mandatory flashing led. The led uses timer
overflow 1 (4.095ms) and a register dec from 127 to
give about .5 sec flashes in the int routine. The code
was ported from another app using the m8. Here is the
strange part. The led would flash 3 times correctly,
the 4th ON time was about twice as long, it would then
flash 5 times correctly, the 6th OFF time was about
twice as long, it would then flash 6 times correctly,
the 7th OFF time was about twice as long. It would then
repeat the sequence! For 2 days!

This morning (+-6am) I felt the need for a jtagice
(nope not expecting) but being Sunday morning no chance
of getting one in a hurry...unless..look up bootleg info
about jtagice, adatpt one of my DXIO-6 module which uses
M8535 (pin compatible with m16) some veroboard and some
connectors and voila, instant jtagice //BRAG MODE ON//
It worked first go!//BRAG MODE still ON// :-)

Meanwhile back at the range...something happened by enabling
disabling OCD and JTAG on the M64. The LED now flashes correctly
even without jtag or programmer plugged in i.e. as it should.
The question remains: Why is it so! Why is the timer now working
as it should? Anyone has any ideas? No I haven't changed anything
in the code, just played around with the 'fully working' jtag.

By the way Dave, I learned from your problems with the Int vectors
last week and copied and pasted them directly from the M64 PDF
into my code. :-))

Regards

John Samperi

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

Re: [AVR-Chat] Why is it so!

2005-03-20 by Russell Shaw

John Samperi wrote:
> G'day
> 
> We I finally got my updated board with the M64 on
> Friday. Put it together and got it running with some
> simple code, USART0 and USART1 talking to 2 terminals
> and the mandatory flashing led. The led uses timer
> overflow 1 (4.095ms) and a register dec from 127 to
> give about .5 sec flashes in the int routine. The code
> was ported from another app using the m8. Here is the
> strange part. The led would flash 3 times correctly,
> the 4th ON time was about twice as long, it would then
> flash 5 times correctly, the 6th OFF time was about
> twice as long, it would then flash 6 times correctly,
> the 7th OFF time was about twice as long. It would then
> repeat the sequence! For 2 days!
> 
> This morning (+-6am) I felt the need for a jtagice
> (nope not expecting) but being Sunday morning no chance
> of getting one in a hurry...unless..look up bootleg info
> about jtagice, adatpt one of my DXIO-6 module which uses
> M8535 (pin compatible with m16) some veroboard and some
> connectors and voila, instant jtagice //BRAG MODE ON//
> It worked first go!//BRAG MODE still ON// :-)

Where do you get the firmware to turn a mega8535 into a jtagice?

> Meanwhile back at the range...something happened by enabling
> disabling OCD and JTAG on the M64. The LED now flashes correctly
> even without jtag or programmer plugged in i.e. as it should.
> The question remains: Why is it so! Why is the timer now working
> as it should? Anyone has any ideas? No I haven't changed anything
> in the code, just played around with the 'fully working' jtag.

Could have something to do with the setting that allows timers
to be stopped or run at full speed during jtag single-stepping.
Show quoted textHide quoted text
> By the way Dave, I learned from your problems with the Int vectors
> last week and copied and pasted them directly from the M64 PDF
> into my code. :-))

Re: [AVR-Chat] Why is it so!

2005-03-20 by John Samperi

At 02:56 PM 20/03/2005, you wrote:
>Where do you get the firmware to turn a mega8535 into a jtagice?

It is not a 8535 but a M16. The board DXIO-6 uses a 8535
which is pin compatible with the M16 so it was quite easy to build
the circuit for the ice as 90% of the stuff is already there i.e.
Power supply, RS232, oscillator etc. The programming socket carries
power and 3 of the signals required fo the ice...so a little veroboard
some connectors a few components and it's all done.
For firmware just do a search for jtagice and you will come
up with lots of usefull info ;-) then Studio does the upgrade to
the lastest firmware.

>Could have something to do with the setting that allows timers
>to be stopped or run at full speed during jtag single-stepping.

Maybe...now it's flashing sporadically with the ice back on.
Lots of new stuff to learn and many questions to ask....

Regards

John Samperi

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

Re: [AVR-Chat] Why is it so!

2005-03-20 by Russell Shaw

John Samperi wrote:
> At 02:56 PM 20/03/2005, you wrote:
> 
>>Where do you get the firmware to turn a mega8535 into a jtagice?
>
> It is not a 8535 but a M16. The board DXIO-6 uses a 8535
> which is pin compatible with the M16 so it was quite easy to build
> the circuit for the ice as 90% of the stuff is already there i.e.
> Power supply, RS232, oscillator etc. The programming socket carries
> power and 3 of the signals required fo the ice...so a little veroboard
> some connectors a few components and it's all done.
> For firmware just do a search for jtagice and you will come
> up with lots of usefull info ;-) then Studio does the upgrade to
> the lastest firmware.

I know a guy that tried that with a mega16 but avr studio wouldn't
see it as a jtag ice. The jtag ice mk-I has a mega163 in it. So you're
saying the firmware from avr studio works unmodified in a mega16? If so,
i'll have another look at his pcb.

>>Could have something to do with the setting that allows timers
>>to be stopped or run at full speed during jtag single-stepping.
> 
> Maybe...now it's flashing sporadically with the ice back on.
> Lots of new stuff to learn and many questions to ask....

Make sure the ice isn't automatically changing any clock fuses,
or loading down VCC on the target pcb.

Re: [AVR-Chat] Why is it so!

2005-03-20 by John Samperi

At 01:30 AM 21/03/2005, you wrote:
>I know a guy that tried that with a mega16 but avr studio wouldn't
>see it as a jtag ice. The jtag ice mk-I has a mega163 in it. So you're
>saying the firmware from avr studio works unmodified in a mega16? If so,
>i'll have another look at his pcb.

You need a proper bootloader in the M16 before studio sees it as a
jtagice, you can then manually upgrade it with AVRprog. The M163
is no longer made but there would be some floating around. The M16
works. There is lots of info on how to get the bootloader set up and
manually upgrade the jtag (DN11 from avrfreaks) and at least one
bootloader...'Out There'..on the net.

Regards

John Samperi

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

Re: [AVR-Chat] Why is it so!

2005-03-20 by Ron

The commercial ECROS JTAGICE uses a MEGA16 and it simply
works without any bootloaders or special considerations and it
was upgradeable with Studio 4.11. Ron
Show quoted textHide quoted text
----- Original Message -----
Sent: Sunday, 20 March, 2005 02:29 PM
Subject: Re: [AVR-Chat] Why is it so!

At 01:30 AM 21/03/2005, you wrote:
>I know a guy that tried that with a mega16 but avr studio wouldn't
>see it as a jtag ice. The jtag ice mk-I has a mega163 in it. So you're
>saying the firmware from avr studio works unmodified in a mega16? If so,
>i'll have another look at his pcb.

You need a proper bootloader in the M16 before studio sees it as a
jtagice, you can then manually upgrade it with AVRprog. The M163
is no longer made but there would be some floating around. The M16
works. There is lots of info on how to get the bootloader set up and
manually upgrade the jtag (DN11 from avrfreaks) and at least one
bootloader...'Out There'..on the net.

Regards

John Samperi

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



Re: [AVR-Chat] Why is it so!

2005-03-21 by John Samperi

At 08:47 AM 21/03/2005, you wrote:
>     The commercial ECROS JTAGICE uses a MEGA16 and it simply
>works without any bootloaders or special considerations and it
>was  upgradeable with Studio 4.11.   Ron

They put the bootloader in ;-) But if you have a blank
M16 (let's say your chip blows up and you want to fix
the ice)then it needs the bootloader to talk to Studio.
It's a once off thing.

Regards

John Samperi

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

Re: Why is it so!

2005-03-21 by upctoys

--- In AVR-Chat@yahoogroups.com, John Samperi <samperi@a...> wrote:
> Meanwhile back at the range...something happened by enabling
> disabling OCD and JTAG on the M64. The LED now flashes correctly
> even without jtag or programmer plugged in i.e. as it should.
> The question remains: Why is it so! Why is the timer now working
> as it should? Anyone has any ideas? No I haven't changed anything
> in the code, just played around with the 'fully working' jtag.
> 
> By the way Dave, I learned from your problems with the Int vectors
> last week and copied and pasted them directly from the M64 PDF
> into my code. :-))
> 
> Regards
> 
> John Samperi
John,

I havn't played with the JTAG on AVRs,but I have with CPLD's. I know 
that CPLD's can play strange games if some of the JTAG pins are left 
unconnected (floating) even if they aren't being actively used. Seems 
to work fine on the bench with the dongle hanging from it but soon as 
it is left to it's own devices intermittant random events can and do 
occur.

Just wondering if something similar is happenig with oyur board. 

Rgds

Stefan

Re: [AVR-Chat] Re: Why is it so!

2005-03-21 by John Samperi

At 09:08 PM 21/03/2005, you wrote:
>I havn't played with the JTAG on AVRs,but I have with CPLD's. I know
>that CPLD's can play strange games if some of the JTAG pins are left
>unconnected (floating) even if they aren't being actively used. Seems
>to work fine on the bench with the dongle hanging from it but soon as
>it is left to it's own devices intermittant random events can and do
>occur.

Status update: OCD and JTAG enabled but no jtag cable connected,
lots more code into the M64. Led flashing happily, messages
being sent out correctly on RS485 com (usart1), relay clicking normally...
it is starting to look and feel just like a bought one :-)

I'll leave it running on it's own overnight. This morning it was flashing
erratically, perhaps I had some junky test code. I'm now starting to put
in it real code and it seems ok. No doubt there will be lots of questions
as I venture out of the comfortable 8K memory boundaries, some of the
registers in the large chips seem to be a bit of a dog's breakfast....
not that there is anything wrong with that!

Regards

John Samperi

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

Re: [AVR-Chat] Why is it so!

2005-03-21 by Ron

Yes I agree, I mis-understood the point of the question. Ron
Show quoted textHide quoted text
----- Original Message -----
Sent: Sunday, 20 March, 2005 10:59 PM
Subject: Re: [AVR-Chat] Why is it so!

At 08:47 AM 21/03/2005, you wrote:
> The commercial ECROS JTAGICE uses a MEGA16 and it simply
>works without any bootloaders or special considerations and it
>was upgradeable with Studio 4.11. Ron

They put the bootloader in ;-) But if you have a blank
M16 (let's say your chip blows up and you want to fix
the ice)then it needs the bootloader to talk to Studio.
It's a once off thing.

Regards

John Samperi

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



Vector table in assembler.

2005-03-21 by Dave VanHorn

For speed, I need to have a bunch of operations that I would normally loop, 
set up in straightline code.
I also need to control how many of these operations that I execute, by 
varying the entry point.

I seem to remember a way to implement vectored jumps, but I can't think 
what it was offhand.

Each entry might be 6-10 instructions, and there may be 256 of them, so 
whatever it is, needs to not use rjmps.
Definitely trading codespace for speed here!, and one of the few places 
where I'm likely to use a macro.

Re: [AVR-Chat] Vector table in assembler.

2005-03-21 by Dennis Kazar

How about an offset table using index referencing another using indexing 
main table of values.
D
Show quoted textHide quoted text
----- Original Message ----- 
From: "Dave VanHorn" <dvanhorn@dvanhorn.org>
To: <AVR-Chat@yahoogroups.com>; <AVR-Chat@yahoogroups.com>
Sent: Monday, March 21, 2005 1:21 PM
Subject: [AVR-Chat] Vector table in assembler.


>
>
>
> For speed, I need to have a bunch of operations that I would normally 
> loop,
> set up in straightline code.
> I also need to control how many of these operations that I execute, by
> varying the entry point.
>
> I seem to remember a way to implement vectored jumps, but I can't think
> what it was offhand.
>
> Each entry might be 6-10 instructions, and there may be 256 of them, so
> whatever it is, needs to not use rjmps.
> Definitely trading codespace for speed here!, and one of the few places
> where I'm likely to use a macro.
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> 



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 3/18/2005

[AVR-Chat] executing a code block 0 to ?? times

2005-03-21 by wg0z@aol.com

one way is to use a subroutine that consists of computational code followed by 1 to 256 occurrences of the macro followed by a RET instruction.
use the computational code to compute start_address as (address_of_RET_instruction - macro_size * number_of_executions_desired), then jump to start_address.
get it?
if the macro size is a power of two then (macro_size * number_of_executions) may be implemented as
"number_of_executions << logbase2(macro_size)"
Show quoted textHide quoted text
-----Original Message-----
From: Dave VanHorn <dvanhorn@dvanhorn.org>
To: AVR-Chat@yahoogroups.com; AVR-Chat@yahoogroups.com
Sent: Mon, 21 Mar 2005 14:21:35 -0500
Subject: [AVR-Chat] Vector table in assembler.





For speed, I need to have a bunch of operations that I would normally loop, 
set up in straightline code.
I also need to control how many of these operations that I execute, by 
varying the entry point.

I seem to remember a way to implement vectored jumps, but I can't think 
what it was offhand.

Each entry might be 6-10 instructions, and there may be 256 of them, so 
whatever it is, needs to not use rjmps.
Definitely trading codespace for speed here!, and one of the few places 
where I'm likely to use a macro.




 
Yahoo! Groups Links

Re: [AVR-Chat] Vector table in assembler.

2005-03-21 by Henry Carl Ott

At 02:21 PM 3/21/2005, you wrote:



>For speed, I need to have a bunch of operations that I would normally loop,
>set up in straightline code.
>I also need to control how many of these operations that I execute, by
>varying the entry point.
>
>I seem to remember a way to implement vectored jumps, but I can't think
>what it was offhand.
>
>Each entry might be 6-10 instructions, and there may be 256 of them, so
>whatever it is, needs to not use rjmps.
>Definitely trading codespace for speed here!, and one of the few places
>where I'm likely to use a macro.


ijmp?

i do something like this:
                 add     zl,ax25_rx_count
                 adc     zh,zero                 ; if a carry from low 
order add it in
                 ijmp

;--- jump table
rx_jmp: rjmp    rx_flag                 ;0 flag
                 rjmp    rx_add_5                ;1 zero stuff, add five 
ones toss zero
                 rcall   rx_add_1                ;2 11110
                 rcall   rx_add_1                ;3 1110
                 rcall   rx_add_1                ;4 110
                 rcall   rx_add_1                ;5 10
                 rjmp    rx_add_0                ;6 0
                 rjmp    rx_flush                ; error, too soon

-carl

Re: [AVR-Chat] Vector table in assembler.

2005-03-21 by Dave VanHorn

At 03:35 PM 3/21/2005, Henry Carl Ott wrote:

>At 02:21 PM 3/21/2005, you wrote:
>
>
>
> >For speed, I need to have a bunch of operations that I would normally loop,
> >set up in straightline code.
> >I also need to control how many of these operations that I execute, by
> >varying the entry point.
> >
> >I seem to remember a way to implement vectored jumps, but I can't think
> >what it was offhand.
> >
> >Each entry might be 6-10 instructions, and there may be 256 of them, so
> >whatever it is, needs to not use rjmps.
> >Definitely trading codespace for speed here!, and one of the few places
> >where I'm likely to use a macro.
>
>
>ijmp?

Ah, I hadn't actually ever used Ijmp before, so I had forgotten it was in 
there
Thanks.

Small computers

2005-03-22 by Dave VanHorn

Harkening back to the discussion of a week ago, is anyone using, or aware 
of a pocket-pc sort of device that could run studio?

Re: [AVR-Chat] Small computers

2005-03-22 by Michael Haisley

Dave, i've done some reasearch this way...do you really need a pocket
pc?  If so, that does significantly limit your options...  Tiqit
really makes about one of the only toys out there that will do what
you need, but you can't get them yet (they have them, i've seen them,
but they aren't shipping yet)    OQO also makes a good device, they
stray a little bit from the traditional hand held form factor, but it
appears to be well worth it, considering the specs.

All in all, I like the oqo, much better than I do the tiqit, but it's
really a matter of if you need the traditional handheld formfactor.  I
just recently got myself pushed into the market for a new laptop, and
am looking small, if funding were not an object, the OQO is the way
that I would go myself.

http://www.oqo.com/hardware/specs/

http://www.tiqit.com/specs.shtml
Show quoted textHide quoted text
On Mon, 21 Mar 2005 21:31:35 -0500, Dave VanHorn <dvanhorn@dvanhorn.org> wrote:
>  
>  Harkening back to the discussion of a week ago, is anyone using, or aware 
>  of a pocket-pc sort of device that could run studio?
>  
>  
>  
>  
>  Yahoo! Groups Sponsor 
>  
>  ADVERTISEMENT
>  
>  
>  ________________________________
>  Yahoo! Groups Links
>  
>  
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AVR-Chat/
>   
> To unsubscribe from this group, send an email to:
> AVR-Chat-unsubscribe@yahoogroups.com
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

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.