Re: Problem linking *without* avr-libc, libm, etc. (SOLVED)

2021-04-30 Thread David Kelly
to count down to zero if( val.low— ) val.high—; Back then AVR-gcc was not smart enough to do the above automatically. I used a lot of uint32_t and uint64_t as counters to mark the passage of time. -- David Kelly N4HHE, dke...@hiwaay.net

Re: static class member as interrupt handler works, but not if class is templated

2021-04-12 Thread David Kelly
functions on longs were dangerous. That not all registers were stacked on entry to the interrupt handler (that would be costly) and the compiler (and support library) assumed some registers were free to use without preserving across function calls. -- David Kelly N4HHE, dke...@hiwaay.net

Re: static class member as interrupt handler works, but not if class is templated

2021-04-10 Thread David Kelly
ode ++ inline rather than let avr-gcc call a library routine. Even more so if in an interrupt. Not all library routines used to be re-entrant. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad.

Re: Where is the error (stdout)

2020-02-07 Thread David Kelly
; I suspect it's because your returning a void instead of an int, In Unix convention its int putc( int, FILE* ) int putchar( int ) Where upon success one returns the character put or -1 or EOF for failure. If replacing standard function one should return the expe

Re: [avr-gcc-list] 24 bits (u)ints

2016-11-30 Thread David Kelly
On Nov 30, 2016, at 8:32 AM, Paul LeoNerd Evans wrote: > Is it possible to get that added to as the expected names > > int24_t > uint24_t I am opposed because 24 is not a standard int. stdint.h standardizes types across compilers. -- David Kelly N4HHE, dke..

Re: [avr-gcc-list] Simple but wrong code

2014-01-14 Thread David Kelly
. You don't return to where you thought you'd return. And registers don't have the contents they had when the ISR was dispatched. Anything is possible. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers wou

Re: [avr-gcc-list] Simple but wrong code

2014-01-14 Thread David Kelly
// disable once used 604: 1d ba out 0x1d, r1; 29 reti(); 606: 18 95 reti } 608: 0f 90 pop r0 60a: 0f be out 0x3f, r0; 63 60c: 0f 90 pop r0 60e: 1f 90 pop r

Re: [avr-gcc-list] >4.5.1 better than this at register-structure (xmega) access?

2012-10-11 Thread David Kelly
rty is leaking? Dereferencing TCC0.CTRLE by taking its address and casting it as a pointer may strip volatile allowing gcc to optimize. It should be able to optimize anyway. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would

Re: [avr-gcc-list] Living With Atmel Studio 6.0

2012-08-09 Thread David Kelly
ly a solid day hunting down the buried small changes in each project's Properties before I finally had a new project that would build. :-( But also some here are mistaking the IDE with the text editor. I am happy with the gnu toolchain, b

Re: [avr-gcc-list] AVR Studio 4.19 does not work with AVR Toolchain 3.4.0 (informative)

2012-08-09 Thread David Kelly
g > > I use Thunderbird and it came in as an entirely new thread. It would if you have deleted the prior messages. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. __

[avr-gcc-list] Living With Atmel Studio 6.0

2012-08-09 Thread David Kelly
what doesn't. Something that knows the files are in a savable state so I don't have to exit AS6 to make sure everything is properly flushed to disk. -- David Kelly N4HHE, dke...@hiwaay.net W

Re: [avr-gcc-list] AVR Studio 4.19 does not work with AVR Toolchain 3.4.0 (informative)

2012-08-09 Thread David Kelly
not a life-threatening deal, but it is one of those things that separate quality technical lists from the riff-raff. The result is a higher quality list archive. If we don't politely point this out now and then nobody will know and this wisdom will be lost as it

Re: [avr-gcc-list] Setting pin to high in function instead of main, instructions in main never run?

2012-03-01 Thread David Kelly
0; > } > > The for(;;) is the interesting part ;-) Thanks! Use for(;;) or while(1) all the time for infinite loops. Was confused because the disassembly didn't list the code which generated rjmp .-2. Was concerned whether for some reason main() was now getting special t

Re: [avr-gcc-list] Setting pin to high in function instead of main, instructions in main never run?

2012-03-01 Thread David Kelly
infinite loop as shown at 0x8a above? Is supposed to ret to caller which then calls _exit or perhaps calls something else. But my point is that int main() is a function that is supposed to return to caller. -- David Kelly N4HHE, dke...@hiwaay.net ===

Re: [avr-gcc-list] Bug in shift operation with avr-gcc

2011-06-07 Thread David Kelly
ts f000 instead of f000 > } Celio, 0x0f is getting shifted left 12 bits into an int16_t (the AVR default variable type) before being promoted to an uint32_t which is when the sign bit gets stretched out. Eric's version expands 0x0f into uint32_t first,

Re: [avr-gcc-list] an idea: adding serial sram to avr to extend heap storage

2011-03-13 Thread David Kelly
ecause I think it adds readability and understanding to my code for ssram access to be obvious where its being used than if it was hidden. Perhaps this is a job for C++? But that also hits on why I do not use C++, that I want to see what is being done, not expect things to be done ma

Re: [avr-gcc-list] including default eeprom values in flash memory

2009-10-21 Thread David Kelly
l but it will be easier to understand 6 months from now than an edit of the Makefile plus hacks to the memory segment definitions. I think it is possible that way to write the .eeprom segment to two places in memory, is just that you don't want to do it that way when there is an easier way that i

Re: [avr-gcc-list] Re: Larger than 64K memory sections

2009-08-27 Thread David Kelly
On Thu, Aug 27, 2009 at 09:55:05AM -0500, David Kelly wrote: > On Wed, Aug 26, 2009 at 08:21:00PM -0700, Parthasaradhi Nayani wrote: > > > Details of application - I have data packets each 32 bytes in size and > > we have accommodate 2000 of these (predefined). > > 32 * 2

Re: [avr-gcc-list] Re: Larger than 64K memory sections

2009-08-27 Thread David Kelly
On Wed, Aug 26, 2009 at 08:21:00PM -0700, Parthasaradhi Nayani wrote: > David Kelly wrote: > > You are right that we know nothing about the application in question > > - details here would make it much easier to give recommendations. > > Hello all, > > I mentioned 4MB

Re: [avr-gcc-list] Re: Larger than 64K memory sections

2009-08-26 Thread David Kelly
EEPROM, or an external device. Otherwise one must manually manage allocation. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. __

Re: [avr-gcc-list] Xmega support

2009-08-19 Thread David Kelly
op-post without trim. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org htt

Re: [avr-gcc-list] Memory problem

2009-06-23 Thread David Kelly
at flash is constant. Something like this might work for you: typedef struct { uint8_t variable; uint16_t a, b, c, d; uint32_t e; } FLASH_STRUCT; #define flash_p ((FLASH_STRUCT *)(0x8000)) Then use flash_p->variable to access. The con of this method is that that

Re: [avr-gcc-list] Memory problem

2009-06-22 Thread David Kelly
a means of controlling the absolute address of allocation. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. ___ AVR-GCC-

Re: [avr-gcc-list] Storing variables in external memory - suggestions

2009-05-22 Thread David Kelly
On Fri, May 22, 2009 at 07:38:36AM -0700, Parthasaradhi Nayani wrote: > > Hello David Kelly, > > Thanks a lot for the suggestions. Yes, I understand that initializing > the variables will not actually save the vales into the memory > locations. I will try a sample code and r

Re: [avr-gcc-list] Storing variables in external memory - suggestions

2009-05-22 Thread David Kelly
ion-lma .eeexternal=0 -O ihex $< $@ Then you need a target such as this which will invoke the above rule (think it needs a blank line after): object_eeext.hex: Finally, believe it goes without saying that you have to provide routines to access your external E

Re: [avr-gcc-list] Allocating variables to a fixed address

2009-05-11 Thread David Kelly
r or provide the customer with the tools to build one of their own. What he is trying to do is in effect create a run time program linker. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first dr

Re: [avr-gcc-list] Allocating variables to a fixed address

2009-05-11 Thread David Kelly
On Mon, May 11, 2009 at 03:56:34PM +0200, Robert von Knobloch wrote: > David Kelly wrote: > > Sounds to me as if you are making the "bootloader" too big and > > should simply link an entire application for every possible target. > > What you are doing would make mor

Re: [avr-gcc-list] Allocating variables to a fixed address

2009-05-11 Thread David Kelly
not have this affecting the main code. Sounds to me as if you are making the "bootloader" too big and should simply link an entire application for every possible target. What you are doing would make more sense if the loadable modules c

Re: [avr-gcc-list] regression in size from 4.2.2 to 4.5.0

2009-05-06 Thread David Kelly
the end of most (not all) routines. Pure waste. But the code ran correctly. > This is a serious bug imho and should be fixed. If its documented then its a feature, not a bug. Want smaller code? Try one of the 3.x compilers. -- David Ke

Re: [avr-gcc-list] External EEPROM verses internal EEPROM data handling

2009-05-04 Thread David Kelly
On Mon, May 04, 2009 at 11:46:40AM -0700, Steven Michalske wrote: > On May 4, 2009, at 11:33 AM, David Kelly wrote: > > > >IIRC the compiler doesn't know internal AVR EEPROM either. AVR > >EEPROM is not mapped in CPU address space but it faked into the load >

Re: [avr-gcc-list] External EEPROM verses internal EEPROM data handling

2009-05-04 Thread David Kelly
pped in CPU address space but it faked into the load map for debugging and device programming. [85 lines deleted under top-post] -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must firs

Re: [avr-gcc-list] External EEPROM verses internal EEPROM data handling

2009-05-04 Thread David Kelly
a hard coded constant. If I was defining the ED structure then I'd store 4 bytes of seconds since some epoch rather than 6 bytes of year, month, day, hour, minute, second. Much simpler, and routines to convert from seconds are readily avai

Re: [avr-gcc-list] Timer0 interrupt on Mega128

2009-04-22 Thread David Kelly
ice required a slow system clock but thats now operated by hand > anyhow). Thanks again! If the SPI device is that slow then it might as well be handled in software. Perhaps that is what "operated by hand" means? -- David Kelly

Re: [avr-gcc-list] main function registers push/pop

2009-04-14 Thread David Kelly
not guarantee disable > -mtiny-stack - not for what I wanted. Isn't this part of what -ffreestanding does? -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destr

Re: [avr-gcc-list] Passing a string variable to lcd_puts

2009-03-27 Thread David Kelly
ess where the C compiler has also thrown complaints for mixing signs. And for "precision loss" when stuffing 32 bits into 8. Generates exactly the same code without complaining if I write u8 = ( u32 & 0xff ); -- David Kelly N4HHE, dke...@hiwaay.net ===

Re: [avr-gcc-list] Passing a string variable to lcd_puts

2009-03-27 Thread David Kelly
ed-char, and -fno-unsigned-char in the avr-gcc man page. So in short plain old "char" is only being sloppy in not explicitly stating signed or unsigned. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would

Re: [avr-gcc-list] Using delay functions with variable F_CPU clock?

2009-03-04 Thread David Kelly
is expandable: if( frequency == LOW_KHZ ) { #define SAVED_F_CPU F_CPU #undef F_CPU #define F_CPU LOW_KHZ _delay_us(us); #undef F_CPU #define F_CPU SAVED_F_CPU #undef SAVED_F_CPU } else {

Re: [avr-gcc-list] Re: sprintf

2009-03-02 Thread David Kelly
e debugger seems to jump around. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org

Re: [avr-gcc-list] Re: sprintf

2009-02-27 Thread David Kelly
de. Also make sure you have specified -g in the compiler flags. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. ___ AVR-GCC-list

Re: [avr-gcc-list] Re: sprintf

2009-02-27 Thread David Kelly
_String[i] = 0xff; > > A_String[i + 1] = 0x00; > > delay_about_1000_processor_cycles(); > > waste_about_2000_bytes_of_code_space(); > > ROTF ! :- sprintf() only costs 2kB? Sure enough, this little program is 2132 bytes after strip: #include main() { char t

Re: [avr-gcc-list] Newbie question

2009-02-25 Thread David Kelly
e, and zero T1. > Then on the second rising edge, grab the count from T1, which is > running at CK/1 Use an input capture I/O bit and let the hardware take a snapshot of the timer value when the edge is detected. Zero latency as long as it doesn't occur faster than you can reset the inp

Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements?

2009-02-20 Thread David Kelly
On Fri, Feb 20, 2009 at 08:00:00AM +0100, Joerg Wunsch wrote: > David Kelly wrote: > > > Strangely the JTAGICE mkII didn't work on the above hardware where the > > ICE Cube did. I put a small 50 mA or maybe 100 mA linear regulator on > > the 3.3V supply and the

Re: [avr-gcc-list] Preferred ICE (was: How to force GCC to not to remove "nop" statements?)

2009-02-19 Thread David Kelly
On Feb 19, 2009, at 9:44 PM, Graham Davies wrote: David Kelly wrote: I have a Microchip 1000 or 2000 ICE thingy that cost about $2000 and was used for one project. Given a choice I much prefer the ECROS ICE Cube, avr-gcc, and of course an AVR. Could I possibly quote that on the "

Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements?

2009-02-19 Thread David Kelly
me because the ICE Cube worked so well. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. ___ AVR-GCC-list mailing list AVR-GCC

Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements?

2009-02-19 Thread David Kelly
ith releases of > both coming up very soon. Thought I ought to reply to make sure its clear that I'm not complaining and very much appreciate the work Eric and Joerg are doing and have done for avr-gcc. Related to another thread: as to why *not* to use an 8051: D

Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?

2009-02-19 Thread David Kelly
ed > the prototype to call it. Hey Joerg, you must be busy! FreeBSD's avr-gcc used to track WinAVR closer than this. :-) -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would

Re: [avr-gcc-list] memcpy() : problem when passing destination pointer

2009-02-11 Thread David Kelly
5 ms! Well, not "more than" but interrupt getMs() for some multiple of 256 ms with a window of about 1 ms. -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad. _

Re: [avr-gcc-list] Re: Strings: escape sequence to insert arbitrary hex value ?

2009-02-05 Thread David Kelly
e ? was intended as wildcard character indicating that any character can be escaped as itself when in doubt? -- David Kelly N4HHE, dke...@hiwaay.net Whom computers would destroy, they must first drive mad.

Re: [avr-gcc-list] Re: Strings: escape sequence to insert arbitrary hex value ?

2009-02-05 Thread David Kelly
is an avr-gcc patch and not standard gcc. Am more certain the support of entering binary values is an avr-gcc enhancement because I see the patch file in the FreeBSD port. -- David Kelly N4HHE, dke...@hiwaay.net

Re: [avr-gcc-list] __DATE__ constant, any way to format it differently ?

2009-01-28 Thread David Kelly
ike when displaying. Should be able to find them at constant offsets at run time. The rule in the Makefile for the file containing __DATE__ needs to be an "always build." -- David Kelly N4HHE, dke...@hiwaay.net Who

Re: [avr-gcc-list] About context saving in Vectors

2009-01-14 Thread David Kelly
On Jan 14, 2009, at 5:58 PM, Daniel O'Connor wrote: On Thursday 15 January 2009 04:15:14 Dave Hylands wrote: And here's some code that implements such a ring buffer. As David Kelly points out, as long as the index type is uint8_t, then nothing special is required (which for this

Re: [avr-gcc-list] About context saving in Vectors

2009-01-14 Thread David Kelly
o the ISR isn't initializing its variables, its making space for them. Can declare your variables as static within the ISR to keep them from being allocated in CPU registers or on the stack. But no matter what, some register space is

Re: [avr-gcc-list] About context saving in Vectors

2009-01-14 Thread David Kelly
bles that are modified inside an ISR they either have to be the size of an atom or otherwise protected against change while being used outside of an ISR. Elements of a ring buffer are are known to be valid and stable for the next few moments based on the values of the buffer indexes. But the buffe

Re: [avr-gcc-list] About context saving in Vectors

2009-01-14 Thread David Kelly
;. > > Which is why there is the macros. Check out: > > ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) > { >... Mangle pointers > } Interesting. Don't recall those being there 3 or 4 years ago back in

Re: [avr-gcc-list] About context saving in Vectors

2009-01-14 Thread David Kelly
pages one must block the interrupt before reading the variable that the interrupt might modify. But this is something warranting further study of your specific code. If instructions are used that read the whole 16 bits without possibility of an interrupt betwe

Re: [avr-gcc-list] address@hidden ... what is it for ?!

2009-01-06 Thread David Kelly
ances. Perhaps when the rest of the device was wiped for a code reload or something? Anyway, it was cheaper to do without the first byte than to worry about it. -- David Kelly N4HHE, dke...@hiwaay.net Whom computer

Re: [avr-gcc-list] RE: 16 bit Timer Issue

2009-01-05 Thread David Kelly
r tools can disassemble and comment an object file as a target in the Makefile. Often all that is needed is a glance at that file's contents to realize the code is not going to do what one expected. Also good for tuning one's C coding style for maxim

Re: [avr-gcc-list] Strange issues with 16-bit values

2008-11-11 Thread David Kelly
like to put the semicolon on a separate line so that the emptiness stands out. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___

Re: [avr-gcc-list] 24 bit Integer

2008-07-14 Thread David Kelly
uint16_tab; uint8_t c; } big_little; struct { uint8_t a; uint16_tbc; } little_big; struct { uint8_t a, b, c; } by

Re: [avr-gcc-list] how to unsubscribe?

2008-07-02 Thread David Kelly
r appeneded to each message has a link to the instructions: > ___ > AVR-GCC-list mailing list > AVR-GCC-list@nongnu.org > http://lists.nongnu.org/mailman/listinfo/avr-gcc-list -- Davi

Re: [avr-gcc-list] __checksum

2008-05-29 Thread David Kelly
; > uint16_t a = pgm_read_word(&__checksum); > > Or something like that. Not only that but if the intent is to CRC the FLASH contents then slow_crc16() needs to be coded accordingly. Is my understanding that slow_crc16() is a standard IAR library function. -- David Kelly N4HHE, [EM

Re: [avr-gcc-list] __checksum

2008-05-29 Thread David Kelly
g at the 2nd argument. Your code above is making an assumption that it is to CRC everything from and including address 0x to but not including a memory location containing __checksum. Avg-gcc isn't going to make or fill a variable

Re: [avr-gcc-list] OS X 4.2.2 -- simplest way today?

2008-05-08 Thread David Kelly
.12. http://www.obdev.at/products/avrusb/index.html -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___ AVR-GCC-list mailing list AVR

Re: [avr-gcc-list] OS X 4.2.2 -- simplest way today?

2008-05-08 Thread David Kelly
Nice touch in including both 3.4.6 and 4.2.2. Default is 3.4.6, but "avr-gcc-select" is a script that will change the default. Would like to see the build tools included. Brief look I don't see any source code in the package or ava

Re: [avr-gcc-list] OS X 4.2.2 -- simplest way today?

2008-04-28 Thread David Kelly
pdates. Or checkout this way and cd to ports/devel before "cvs update" % cvs -d [EMAIL PROTECTED]:/home/ncvs co ports/devel/ avr-gcc ports/devel/avr-binutils ports/devel/avr-libc -- David Kelly N4HHE, [EMAIL PROTECTED]

[avr-gcc-list] Default location for .indent.pro in WinAVR?

2008-04-16 Thread David Kelly
One option is to set the environment variable INDENT_PROFILE to the location of one's default .indent.pro for GNU Indent, but I'd like to know where the program searches by default? It doesn't seem to be: C:\Documents and Settings\dkelly -- David Kelly N4HHE, [

Re: [avr-gcc-list] AVR-Gcc and overflow behavior

2008-04-14 Thread David Kelly
nclude for all my type definitions. This way there is no question as to the size or signedness of a char when its uint8_t. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would

Re: [avr-gcc-list] memcpy

2008-03-29 Thread David Kelly
stand your question. memcpy() isn't an inline function, its a called function like most everything else. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first

Re: [avr-gcc-list] I need some help I am trying to use interrupts but...sigh!!

2008-03-19 Thread David Kelly
On Mon, Mar 17, 2008 at 09:28:47PM -0700, atifplus wrote: > > so as long as my move variable is 1 2 3 or 4 the interrupt should keep > sending pulse accordingly but i am not getting anything on portB > PORTB |= (0 << PB3)|(0 << PB4); Do you really believe you can OR a 0 into bit location

Re: [avr-gcc-list] PORTC

2008-03-11 Thread David Kelly
jdump -dS" usually produces very good output. "-DS" does the same as -dS plus a whole bunch of crap disassembled where its not code. At least when one uses -O2 to compile. -- David Kelly N4HHE, [EMAIL PROTECTED]

Re: [avr-gcc-list] Tip: handling volatile operands

2008-01-10 Thread David Kelly
(a& 0x0c)) > { > } > > Will produce much better code! You changed horses in the middle of the stream. Replace "if" above with "while" that you started with and your non-volatile may loop forever based on one read. The solution is to rol

Re: [avr-gcc-list] Where/how to get latest stable version?

2008-01-05 Thread David Kelly
, but I'm looking at some new parts... There are/were older ports in fink and darwin-ports. You could start with one of those. I would recommend closely following Joerg's FreeBSD port as it and WinAVR march pretty much march in lockstep as the state-of-the-art avr-gcc. -- David K

Re: [avr-gcc-list] stumped: minor refactoring of simple program causes it to fail

2008-01-03 Thread David Kelly
all:object.elf object.list It was the .list file I was looking at last night that looked reasonable. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad.

Re: [avr-gcc-list] Fine Tuning code timings

2008-01-02 Thread David Kelly
t; depending on the next Tx bit value. There is a mode where one only writes the BIT_TIME in the OCRx register once and the paired timer resets to 0 with the output bit change. So all you have to do in the ISR is to decide which output value is to be sent next. The transmitted timing will be as pr

Re: [avr-gcc-list] Fine Tuning code timings

2007-12-28 Thread David Kelly
ing output bits from interrupt is fine. If its picky then connect the OCR timer to its output bit and let the hardware do it. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they

Re: [avr-gcc-list] Howto put constants on fixed address

2007-12-20 Thread David Kelly
is not capable of doing this. Placing object code around fixed obstacles is a common embedded task. And not uncommon in non-embedded applications. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom c

Re: [avr-gcc-list] Howto put constants on fixed address

2007-12-19 Thread David Kelly
. I think this URL describes the syntax to do what Martin is looking to do: http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_21.html#SEC21 More hints here, in that one can edit the . address: http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_10.html -- David

Re: [avr-gcc-list] Howto put constants on fixed address

2007-12-19 Thread David Kelly
your own. Due to the memory map I had I/O in the midst of my EPROM space. Once I got the Introl linker working the way I wanted it nicely split my object code around the I/O sections. One must question the need to map constants to a predetermined location in FLASH?

Re: [avr-gcc-list] invalid ram address

2007-12-13 Thread David Kelly
in > outside the maximum address (example : 0xA64) Is it a bug ? Or maybe I > have to configure something ? Yes its a bug in your software. The ATmega32 has 2k of RAM, 0x0800 bytes. Starts at 0x0060 and ends with $0x085f. 0x0a64 is way out of range. -- Davi

Re: [avr-gcc-list] dev and mod may not be optimized

2007-12-11 Thread David Kelly
out of __udivmodqi4 with relative ease: a = slashmod_u8( numerator, denominator, &remainder ); -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first

Re: [avr-gcc-list] Problem with timer0 overflow interrupt in clanguage..

2007-12-10 Thread David Kelly
On Mon, Dec 10, 2007 at 12:51:31PM +0100, Schwichtenberg, Knut wrote: On Friday, December 07, 2007 5:24 PM, David Kelly wrote: The compiler won't read PINB using the above. In general on AVR when one reads PORTB one reads the output latchs, in other words the last value written. On

Re: [avr-gcc-list] Problem with timer0 overflow interrupt in c language..

2007-12-07 Thread David Kelly
~PORTB; 3ee: 85 b1 in r24, 0x05 ; 5 3f0: 80 95 com r24 3f2: 85 b9 out 0x05, r24 ; 5 PORTB ^= 0xff; 3f4: 85 b1 in r24, 0x05 ; 5 3f6: 80 95 com r24 3f8: 85 b9 out 0x05, r24

Re: [avr-gcc-list] Problem with timer0 overflow interrupt in c language..

2007-12-06 Thread David Kelly
han you have, you can put a software divider in your code. This should stretch it to 3.8 seconds per toggle: ISR (TIMER0_OVF_vect) { static uint8_t divider; if( divider ) { divider--; } else { divider = 100; // whatever you want to

Re: [avr-gcc-list] Problem with timer0 overflow interrupt in c language..

2007-12-06 Thread David Kelly
big potential problem. The other is that his LED is flashing too fast to see, assuming its wired correctly. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must f

Re: [avr-gcc-list] ATmega644 pin-change interrupts

2007-11-29 Thread David Kelly
On Thu, Nov 29, 2007 at 09:25:12AM -0600, David Kelly wrote: > > I too have not found one. I snag a copy of the PINx and keep it in a > static variable in my ISR() to compare for which pins changed. Something > like this: > > current = PINA & PCMSK0;//

Re: [avr-gcc-list] ATmega644 pin-change interrupts

2007-11-29 Thread David Kelly
le in my ISR() to compare for which pins changed. Something like this: current = PINA & PCMSK0;// only the pins enabled xor = previous ^ current; // pins changed since last time ... previous = current; return;

Re: [avr-gcc-list] OS X install

2007-10-17 Thread David Kelly
the FreeBSD systems. ICE on XP with AVR Studio, WinAVR, and TortoiseSVN. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___ AV

Re: [avr-gcc-list] stumped by my ATmega48 (again)

2007-10-05 Thread David Kelly
PORTC = 0x7f; PORTD = 0xff; for( ;; ) ; return 0 Then again we've discussed the removal of empty loops to death. Make sure the compiler doesn't optimize out that empty loop. Possibly it recognizes it as infinite and leaves it alone.

Re: [avr-gcc-list] Warning message

2007-10-03 Thread David Kelly
me, notice the difference between: (uint8_t)(~(0x55)) and ~((uint8_t)(0x55)) When 0x55 is sitting around bare its an int. The 2nd example puts it into uint8_t first, then complements and remains uint8_t. The first complements the int then chops it down to fit in a uint8_t. -- Da

Re: [avr-gcc-list] Warning message

2007-10-03 Thread David Kelly
ut loss of resolution so the compiler doesn't complain. When complimented it no longer fits so the compiler complains. I would recommend changing its definition: #define CHK_1307((uint8_t) 0x55) -- David Kelly N4HHE, [EMAIL PROTECTED] ===

Re: [avr-gcc-list] Problem with delay loop

2007-10-02 Thread David Kelly
aims *software* knows better. Avr-gcc *has* a delay loop that the compiler recognizes and leaves alone. You've been told about yet you have written more email than the amount of code you would have to change to use it. -- David Kelly N4HHE, [EMAIL PROTECTED] ==

Re: [avr-gcc-list] Problem with delay loop

2007-09-28 Thread David Kelly
On Sep 28, 2007, at 8:58 PM, Graham Davies wrote: David Kelly wrote: ... because it was volatile it *had* to be fetched and stored each time. Oh boy. That's a really interesting statement (to me anyway, but I have a volatile fetish). You're saying that having chosen to

Re: [avr-gcc-list] Problem with delay loop

2007-09-28 Thread David Kelly
f sbcir25, 0xFF ; 255 e0: 81 f7 brne.-32 ; 0xc2 e2: 08 95 ret -- David Kelly N4HHE, [EMAIL PROTECTED] Whom comp

Re: [avr-gcc-list] Problem with delay loop

2007-09-28 Thread David Kelly
On Fri, Sep 28, 2007 at 09:05:40AM -0500, David Kelly wrote: > > For finer delays don't forget the OCR functions on the timers. Is pretty > easy to write and create very accurate delays with: > > void delay( uint8_t delay ); > { > OCR2A = TCNT2 +

Re: [avr-gcc-list] Problem with delay loop

2007-09-28 Thread David Kelly
On Fri, Sep 28, 2007 at 01:29:19PM +0530, Royce Pereira wrote: > Hi all, > > In the latest WinAVR (avr-gcc (GCC) 4.1.2 (WinAVR 20070525) I found this. > > Check this out: > //== > void delay(unsigned del_cnt) > { >while(del_cnt--); > >return; > } > //=

Re: [avr-gcc-list] avr-gcc won't compile (xgcc has bad cmdline option "-march=i586")

2007-09-11 Thread David Kelly
to build gcc, then attempted to use that gcc to build itself as the final test. Also so as to have a gcc compiled by gcc. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would dest

Re: [avr-gcc-list] avr-gcc won't compile (xgcc has bad cmdline option"-march=i586")

2007-09-11 Thread David Kelly
4.1.2 for his Linux to see if it fails the same way? -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___ AVR-GCC-list mailing list

Re: [avr-gcc-list] avr-gcc won't compile (xgcc has bad cmdline option "-march=i586")

2007-09-11 Thread David Kelly
its xgcc (of _mulqi3.o): > > /home/root/shed/gcc-4.1.2/obj-avr/./gcc/xgcc Stop right there. You are trying to cross compile avr-gcc 4.1.2 with 3.4.6? Seems like that is begging for trouble. You know the easiest platform to run avr-gcc is Windows? Close second is FreeBSD. MacOS X and Linux

Re: [avr-gcc-list] mac-avr

2007-07-09 Thread David Kelly
tting much attention. -- David Kelly N4HHE, [EMAIL PROTECTED] Whom computers would destroy, they must first drive mad. ___ AVR-GCC-list mailing list AVR-GCC-list@nongn

Re: [avr-gcc-list] mac-avr

2007-07-08 Thread David Kelly
projects using the name MacAVR. Are you one of those or another? I have installed but only briefly experimented with the avr-gcc and supporting tools in Fink. Joerg's FreeBSD port has been very good under FreeBSD. -- David Kelly N4HHE, [EMAIL PROT

  1   2   >