Yahoo Groups archive

AVR-Chat

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

Messages

Browse messages

Page 16 of 307 · 15341 messages matched

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-29 by Steve Hodge

+1, Steve From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of wagnerj@proaxis.com Sent: Thursday, March 29, 2012 9:24 AM To: AVR-Chat@yahoogroups.com Subject: Re: [AVR-Chat] Re: Mixing C and assembly with special requirements. Very informative thread! Mu

Thread view Attachments: 0

Re: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-29 by wagnerj@proaxis.com

> --- In AVR-Chat@yahoogroups.com, "Tim Mitchell" wrote: >> And remember to save SREG in interrupt routines. > Unless, of course, it isn't modified. Although usually not the case, it > is possible to construct an ISR that does not modify SREG. Take, for > example, this one that t

Thread view Attachments: 0

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-29 by Tim Mitchell

----Original Message---- From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Don Kinzer Sent: 29 March 2012 16:05 To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Re: Mixing C and assembly with special requirements. > --- In AVR-Chat@yahoogroups.com, "Ti

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-29 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "Tim Mitchell" wrote: > And remember to save SREG in interrupt routines. Unless, of course, it isn't modified. Although usually not the case, it is possible to construct an ISR that does not modify SREG. Take, for example, this one that toggles an

Thread view Attachments: 0

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-29 by Steve Hodge

Thanks for the help, tips and pitfalls to watch for. I've looked at the links and I think I have it more or less figured out. Steve From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Tim Mitchell Sent: Thursday, March 29, 2012 1:29 AM To: AVR-Chat@yahoo

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-29 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "Tim Mitchell" wrote: >[Y]ou have to know exactly how the compiler has >stored the structs in RAM. On a host like the AVR where there is no penalty for accessing a byte-aligned data item one generally uses the compiler option -fpack-struct to ensu

Thread view Attachments: 0

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-29 by Tim Mitchell

----Original Message---- From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Don Kinzer Sent: 28 March 2012 19:17 To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Re: Mixing C and assembly with special requirements. > --- In AVR-Chat@yahoogroups.com, "St

Thread view Attachments: 0

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-28 by Steve Hodge

Thanks a lot for the info, Don. I'll check it out later today (side-tracked on something else right now). Steve From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Don Kinzer Sent: Wednesday, March 28, 2012 11:33 AM To: AVR-Chat@yahoogroups.com Subject:

Thread view Attachments: 0

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-28 by Steve Hodge

Tim, this was also very helpful to me also. Thanks. Besides plain variables, what do you do to pass C arrays and C structs? Steve From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Tim Mitchell Sent: Tuesday, March 27, 2012 1:51 AM To: AVR-Chat@yahoogro

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-28 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "Don Kinzer" wrote: > I've posted a simple example available at the link below. After reviewing the example, it will probably be obvious that the structure offset/size definitions for the assembly language code represent a double maintenance issue

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-28 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "Steve Hodge" wrote: > what do you do to pass C arrays and C structs? The assembly knows nothing about C structures or even simple C types. Consequently, you have to write the code manually to index arrays and access structure elements. I've poste

Thread view Attachments: 0

Re: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-28 by fireweaver

On 3/27/2012 8:30 PM, Don Kinzer wrote: > --- In AVR-Chat@yahoogroups.com, fireweaver wrote: >> This is the version that I am using in my DRO. > It would be a lot more convenient for those trying to help you if you would put the file on DropBox or some other server so that it can

Thread view Attachments: 0

Re: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-28 by fireweaver

On 3/27/2012 11:43 AM, Don Kinzer wrote: > --- In AVR-Chat@yahoogroups.com, fireweaver wrote: >> So I should write: >> subi ZL,0xFF-low(X_actions) >> lpm ZL,Z ; > ijmp > Yes, if you want to load the value from the table entry into ZL. Also, I suspect that the instruction precedin

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-28 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, fireweaver wrote: >This is the version that I am using in my DRO. It would be a lot more convenient for those trying to help you if you would put the file on DropBox or some other server so that it can be accesses with the formatting preserved. Do

Thread view Attachments: 0

Re: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-27 by fireweaver

On 3/27/2012 9:27 AM, Don Kinzer wrote: > > > --- In AVR-Chat@yahoogroups.com, fireweaver wrote: >> I don't know how this will appear since the >> group forbids attachments. > It got quite mangled, of course. If you don't have a server where you can store files you can use a serv

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-27 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, fireweaver wrote: > So I should write: > subi ZL,0xFF-low(X_actions) > lpm ZL,Z ; ijmp Yes, if you want to load the value from the table entry into ZL. Also, I suspect that the instruction preceding the lpm should actually be subi ZL,0-low(X_actio

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-27 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, fireweaver wrote: > I don't know how this will appear since the > group forbids attachments. It got quite mangled, of course. If you don't have a server where you can store files you can use a service like DropBox. An account with a 2GB limit is f

Thread view Attachments: 0

RE: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-27 by Tim Mitchell

I'm a bit of an assembly nut and have had good results mixing asm and c. (But not reserving registers, that just ties the compiler in knots) I create an asm.s file in the project and define any variables I need in one of the c files. Then using .extern in the asm file you can use

Thread view Attachments: 0

Re: [AVR-Chat] Re: Mixing C and assembly with special requirements.

2012-03-27 by fireweaver

On 3/26/2012 3:46 PM, Don Kinzer wrote: > --- In AVR-Chat@yahoogroups.com, fireweaver wrote: >> The decoder I have does its thing in about 28 cycles. As a C >> interrupt routine, it is well over 100 cycles and may not be >> able to keep up with the encoder. > If you are willing t

Thread view Attachments: 0

Re: [AVR-Chat] Mixing C and assembly with special requirements.

2012-03-26 by fireweaver

On 3/26/2012 1:33 PM, David Kelly wrote: > On Mar 26, 2012, at 2:57 PM, fireweaver wrote: > >> I have a question of some concern to me, perhaps you could help. >> >> In overview, it involves mixing assembly language and C code. >> >> In detail: >> >> The CPU that I am using is AT

Thread view Attachments: 0

Mixing C and assembly with special requirements.

2012-03-26 by fireweaver

I have a question of some concern to me, perhaps you could help. In overview, it involves mixing assembly language and C code. In detail: The CPU that I am using is ATmega328 using AVR Studio 5 as a development environment. I an writing a motor control application that involves a

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-26 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, fireweaver wrote: > The decoder I have does its thing in about 28 cycles. As a C > interrupt routine, it is well over 100 cycles and may not be > able to keep up with the encoder. If you are willing to post the existing assembly code and provide a

Thread view Attachments: 0

Re: [AVR-Chat] Mixing C and assembly with special requirements.

2012-03-26 by David Kelly

On Mar 26, 2012, at 2:57 PM, fireweaver wrote: > > I have a question of some concern to me, perhaps you could help. > > In overview, it involves mixing assembly language and C code. > > In detail: > > The CPU that I am using is ATmega328 using AVR Studio 5 as a development > envi

Thread view Attachments: 0

Re: Mixing C and assembly with special requirements.

2012-03-26 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, fireweaver wrote: > Can I somehow tell the C compiler that comes with AVR > Studio that these certain five registers are reserved > for the exclusive use of the decoder and therefore avoid > using them in any way? In general, no. It is possible to

Thread view Attachments: 0

Re: [AVR-Chat] Reading PWM duty cycle

2012-03-26 by Jim Wagner

On Mar 25, 2012, at 5:58 PM, Philippe Habib wrote: > Has anyone used the Atmel sample code from ap note AVR135 to read duty cycle of a PWM input? > > I'm using it on an ATMEGa48 and running into some interaction with another timer/counter. I am using the internal oscillator at 8M

Thread view Attachments: 0

Reading PWM duty cycle

2012-03-26 by Philippe Habib

Has anyone used the Atmel sample code from ap note AVR135 to read duty cycle of a PWM input? I'm using it on an ATMEGa48 and running into some interaction with another timer/counter. I am using the internal oscillator at 8Meg as my clock. My PWM input signal goes into PB0/ICP1. I

Thread view Attachments: 0

Re: [AVR-Chat] Negarive numbers in .db statements

2012-03-21 by Jim Wagner

On Mar 21, 2012, at 7:23 AM, David VanHorn wrote: > On Wed, Mar 21, 2012 at 3:05 AM, STEVEN HOLDER > wrote: > > David, > > > > If you need to change the sign, you could cast the signbit as a signed char and xor with 0x80, which is the sign bit, would that do the trick as not quie

Thread view Attachments: 0

Re: [AVR-Chat] Negarive numbers in .db statements

2012-03-21 by David VanHorn

On Wed, Mar 21, 2012 at 3:05 AM, STEVEN HOLDER wrote: > David, > > If you need to change the sign, you could cast the signbit as a signed char and xor with 0x80, which is the sign bit, would that do the trick as not quiet sure what you are trying to do. That won't get it for me.

Thread view Attachments: 0

Re: Negarive numbers in .db statements

2012-03-21 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, David VanHorn wrote: >I need the distortion to be positive or negative.. I've never used avrasm before but I just tried this and it seems to work. .equ SignBit = (0-1) .equ Thing = 5 .db Thing,(Thing + (3*SignBit)), (Thing - (3*SignBit)), Thing Do

Thread view Attachments: 0

Re: [AVR-Chat] Negarive numbers in .db statements

2012-03-21 by STEVEN HOLDER

David, If you need to change the sign, you could cast the signbit as a signed char and xor with 0x80, which is the sign bit, would that do the trick as not quiet sure what you are trying to do. Regards ________________________________ From: David V To: AVR-Chat@yahoogroups.com Se

Thread view Attachments: 0

Negarive numbers in .db statements

2012-03-21 by David V

All this time working with the AVR, and I've never had to do this... I need a way to change the sign on a term in a .db statement. Something like this: (which does not work..) .equ SignBit = -1; .db Thing,(Thing + (3*SignBit)), (Thing - (3*SignBit)), Thing .and so on.. Otherwise,

Thread view Attachments: 0

Re: Atmel attiny85-su

2012-03-14 by jrader30

Thank you, Clark, and Jim. I shortened the leads and moved it closer to the Avr dragon board, and that corrected it. I had just read several of the dips using the zif socket I installed on the dragon board with no problem. Ran the leads from the socket to the new chip installed o

Thread view Attachments: 0

Re: [AVR-Chat] Atmel attiny85-su

2012-03-14 by Jim Wagner

On Mar 13, 2012, at 8:57 PM, Clark Martin wrote: > > On Mar 13, 2012, at 5:48 PM, jrader30 wrote: > > > I wanted to use the Attiny85-su soic chip in place of the larger dip version, all specs are the same as size is supposed to be the only dofference. Using Avr studio 5.1 and the

Thread view Attachments: 0

Re: [AVR-Chat] Atmel attiny85-su

2012-03-14 by Clark Martin

On Mar 13, 2012, at 5:48 PM, jrader30 wrote: > I wanted to use the Attiny85-su soic chip in place of the larger dip version, all specs are the same as size is supposed to be the only dofference. Using Avr studio 5.1 and the Avr dragon to program. Avr studio says "unable to enter

Thread view Attachments: 0

RE: [AVR-Chat] ATMega1284p External Interrupt 2 Setup

2012-03-14 by Chuck Hackett

> From: John Samperi > .... > >Sorry for talking to myself so much :-) ... > > That's not what's worrying me, the answering to yourself is a sign of > madness they say... :-) Darn, you obviously know me ... :-) > I don't have one of those chips but I may be able to try it on a M6

Thread view Attachments: 0

Atmel attiny85-su

2012-03-13 by jrader30

I wanted to use the Attiny85-su soic chip in place of the larger dip version, all specs are the same as size is supposed to be the only dofference. Using Avr studio 5.1 and the Avr dragon to program. Avr studio says "unable to enter programming mode, the read id does not match th

Thread view Attachments: 0

RE: [AVR-Chat] ATMega1284p External Interrupt 2 Setup

2012-03-13 by John Samperi

At 02:18 AM 14/03/2012, you wrote: >Sorry for talking to myself so much :-) ... That's not what's worrying me, the answering to yourself is a sign of madness they say... :-) I don't have one of those chips but I may be able to try it on a M644p a little later. Regards John Samper

Thread view Attachments: 0

RE: [AVR-Chat] ATMega1284p External Interrupt 2 Setup

2012-03-13 by Chuck Hackett

> From: Chuck Hackett > .... Sorry for talking to myself so much :-) ... I placed "uint8_t test = EICRA;" after setting EICRA and "test" did have the expected 0x20 in it ... but AVR Studio still shows the EICRA as 0x00 so I think I've confirmed that the Dragon or AVR Studio has a

Thread view Attachments: 0

RE: [AVR-Chat] ATMega1284p External Interrupt 2 Setup

2012-03-13 by Chuck Hackett

> From: Chuck Hackett > .... > Just found the (non) problem: Apparently AVR Studio (Version 4.18, build > 716) has a bug in it? > .... False alarm, the interrupt is still not working so I'm guessing that the EICRA register really isn't getting set and is still 0x00 ... So origina

Thread view Attachments: 0

RE: [AVR-Chat] ATMega1284p External Interrupt 2 Setup

2012-03-13 by Chuck Hackett

> From: Chuck Hackett Added info: I am using AVR Studio and a Dragon for the JTAG debug connection. If I attempt to change the EICRA register with AVR Studio it changes but is back to 0x00 after the next statement execution (the statement does not modify the EIARA register). ....

Thread view Attachments: 0

ATMega1284p External Interrupt 2 Setup

2012-03-13 by Chuck Hackett

I am trying to enable external interrupt 2 to trigger on a falling edge on an ATMega1284p but I am unable to get the proper bits in the EICRA register. I'm using the following: (1) EIMSK &= ~_BV( INT2 ); // Disable external interrupt 2 (2) EICRA &= ~(_BV( ISC21 ) | _BV( ISC20 ));

Thread view Attachments: 0

RE: [AVR-Chat] weird mega88 problem

2012-03-09 by Tim Mitchell

The stuck bit is a weird one, I did change the chip and it was fine then. But I've been using AVR's since they started making them and never seen anything like that before. -- Tim Mitchell

Thread view Attachments: 0

Re: [AVR-Chat] weird mega88 problem

2012-03-08 by Mike Bronosky

Blame it on the sun storm. Mike -- Linux since March 2004 www.counter.li.org Registered Linux User: #482134 Taking up Linux Ubuntu and give-up the Windos habit. Hasta la Vista, Baby. I won't be back! [Non-text portions of this message have been removed]

Thread view Attachments: 0

Re: [AVR-Chat] weird mega88 problem

2012-03-08 by David VanHorn

> I fixed the second problem, it turned out to be a problem with the oscillator - it was not set to "full swing" and an LED power supply near the processor was causing the oscillator to stop and do unpredictable things. Very strange symptoms though. From a better console: I've se

Thread view Attachments: 0

RE: [AVR-Chat] weird mega88 problem

2012-03-08 by Dave

The low power oscillator is evil. Tim Mitchell wrote: >It's not in any debugger... I found out what was going on by writing values to eeprom then reading it back using AVRISP. > > >I fixed the second problem, it turned out to be a problem with the oscillator - it was not set to "

Thread view Attachments: 0

Re: [AVR-Chat] weird mega88 problem

2012-03-08 by Zack Widup

It's possibly a bad chip. Does only one Mega88 have this problem? Have you tried substituting another? Bad Chips DO get sold once in a while. Zack On Thu, Mar 8, 2012 at 10:42 AM, Dave wrote: > ** > > > Is this by chance in the debugger or jtag ice? > > > Tim Mitchell wrote: > >

Thread view Attachments: 0

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.