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
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
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.
ause 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 expected value else something
On Nov 30, 2016, at 8:32 AM, Paul LeoNerd Evans <leon...@leonerd.org.uk> 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.
--
Davi
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 r1
610: 18 95 reti
--
David Kelly N4HHE, dke...@hiwaay.net
.
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 would destroy, they must first
. 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 already is on many other lists.
I think Graham handled it very well.
--
David Kelly N4HHE, dke...@hiwaay.net
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
Whom computers would destroy, they must first drive mad
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
with the text editor.
I am happy with the gnu toolchain, build with Makefile. Edit with something
else. But the one big thing Atmel needs to get right is the debugger.
--
David Kelly N4HHE, dke...@hiwaay.net
Whom computers would destroy
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 treatment but now
reassured that it is not.
--
David Kelly N4HHE, dke...@hiwaay.net
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, before the shift.
--
David Kelly N4HHE, dke...@hiwaay.net
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 is also easier to understand.
--
David Kelly N4HHE
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 flash as it is the HW spec
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 * 2000 = 6400 bytes.
Arrgh! Decaf
device. Otherwise one
must manually manage allocation.
--
David Kelly N4HHE, dke...@hiwaay.net
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
.
--
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
http://lists.nongnu.org/mailman
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 all accounting of flash use has to
be done manually by the code author.
--
David Kelly N4HHE, dke
.
--
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
http://lists.nongnu.org/mailman
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 EEPROM device.
--
David Kelly N4HHE, dke...@hiwaay.net
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 revert. Thanks once again
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 could run out of
RAM.
--
David Kelly N4HHE, dke...@hiwaay.net
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 more sense if the loadable modules
could
linker.
--
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
http
. 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 Kelly N4HHE, dke...@hiwaay.net
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
available in OS's and spreadsheets.
--
David Kelly N4HHE, dke...@hiwaay.net
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 first drive mad
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
map for debugging and device programming
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 N4HHE, dke...@hiwaay.net
-stack - not for what I wanted.
Isn't this part of what -ffreestanding does?
--
David Kelly N4HHE, dke...@hiwaay.net
Whom computers would destroy, they must first drive mad.
___
AVR
sloppy in not explicitly
stating signed or unsigned.
--
David Kelly N4HHE, dke...@hiwaay.net
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
into 8. Generates exactly the same code
without complaining if I write u8 = ( u32 0xff );
--
David Kelly N4HHE, dke...@hiwaay.net
Whom computers would destroy, they must first drive mad
F_CPU
#define F_CPU LOW_KHZ
_delay_us(us);
#undef F_CPU
#define F_CPU SAVED_F_CPU
#undef SAVED_F_CPU
} else {
do_delay(us);
}
--
David Kelly N4HHE, dke...@hiwaay.net
Whom
;
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 stdio.h
main()
{
char tmp[100];
sprintf( tmp, %d, 10 );
}
--
David Kelly N4HHE, dke
On Fri, Feb 20, 2009 at 08:00:00AM +0100, Joerg Wunsch wrote:
David Kelly dke...@hiwaay.net 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 mkII drew more power
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 destroy, they must first drive mad
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:
Doesn't have avr-gcc.
--
David Kelly N4HHE, dke...@hiwaay.net
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 User
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.
___
AVR-GCC
in doubt?
--
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
http://lists.nongnu.org
.
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 between the bytes then no protection is necessary.
--
David Kelly N4HHE, dke...@hiwaay.net
out:
ATOMIC_BLOCK( ATOMIC_RESTORESTATE )
{
... Mangle pointers
}
Interesting. Don't recall those being there 3 or 4 years ago back in the
days of avr-gcc 3.3 and 3.4.
--
David Kelly N4HHE, dke...@hiwaay.net
Whom
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 needed for any non-trivial ISR.
--
David Kelly N4HHE, dke...@hiwaay.net
Whom
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 particular
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 maximum avr-gcc
performance.
--
David Kelly N4HHE, dke...@hiwaay.net
that the emptiness stands out.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http
;
struct {
uint8_t a;
uint16_tbc;
} little_big;
struct {
uint8_t a, b, c;
} byte;
} MY24BITS;
--
David Kelly N4HHE, [EMAIL PROTECTED
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
--
David Kelly N4HHE, [EMAIL PROTECTED
address 0x to but not including a memory location containing
__checksum.
Avg-gcc isn't going to make or fill a variable named __checksum unless
you do it yourself.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers
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, [EMAIL PROTECTED]
Whom computers would destroy
, 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 available at the site to download.
--
David Kelly N4HHE, [EMAIL PROTECTED
/products/avrusb/index.html
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http
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, [EMAIL PROTECTED
. 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 destroy, they must first drive mad
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 drive mad
and PB4?
This is what I think you intended:
PORTB = ~( (1PB3) | (1PB4) );
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
. Replace if above with
while that you started with and your non-volatile may loop forever
based on one read.
The solution is to roll your conditions into one test:
while( ioport ( 1 | 2 | 0x0c ) )
{
}
--
David Kelly N4HHE, [EMAIL PROTECTED
, 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 Kelly N4HHE
file I was looking at last night that looked
reasonable.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing
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 precise as your timer.
--
David Kelly N4HHE, [EMAIL PROTECTED
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 must first drive mad
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?
--
David Kelly N4HHE, [EMAIL PROTECTED
.
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
(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.
--
David Kelly N4HHE, [EMAIL PROTECTED
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 other
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 ; 5
--
David Kelly N4HHE
changed. Something
like this:
current = PINA PCMSK0;// only the pins enabled
xor = previous ^ current; // pins changed since last time
...
previous = current;
return;
--
David Kelly N4HHE, [EMAIL PROTECTED
FreeBSD machine, a
local FreeBSD machine, local XP machine, and my Mac. Most composition
was in BBEdit on Mac. File transfer/sync was via svn. Syntax error check
compiles were via Terminal.app over ssh to one of the FreeBSD systems.
ICE on XP with AVR Studio, WinAVR, and TortoiseSVN.
--
David Kelly
;
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.
--
David Kelly N4HHE, [EMAIL
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]
Whom computers would destroy, they must first
/delay_basic.h yet you have written
more email than the amount of code you would have to change to use it.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
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 put
-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 run distant third.
--
David Kelly N4HHE, [EMAIL
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
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 destroy, they must first drive mad
attention.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http
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 PROTECTED
cause
gcc to bellyache. Haven't tried it, just guessing.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing
output latches containing the value last written. A bitfield
works fine on the output latch register.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
On Oct 14, 2006, at 8:29 AM, Niklas Lövgren wrote:
Hmmm. It seems some people lack social skills!
Submit a bug report. Maybe it'll make it into GCC 6.6.6. :-)
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers
, and I don't know what else.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
disassembly listing. Get lots of warnings like this:
ui.c:762: warning: passing arg 1 of `eeprom_read_byte' makes pointer
from integer without a cast
...which might contribut to avr-gcc getting confused and not properly
tagging source with code.
--
David Kelly N4HHE, [EMAIL PROTECTED
drivers and write my
own stack.
The OS requirement for uIP can't be anything much more than for you
to provide software timers for it to keep track of time.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would
On Mar 23, 2006, at 1:06 AM, rajeev joshi wrote:
can somebody please tell me which OS is suitable for 8-bit AVR with 8k
flash memory.
Could be of more help if you would explain *why* you want an OS. Some
are stronger in certain features than others.
--
David Kelly N4HHE, [EMAIL PROTECTED
is inlined then all bets are off.
do{} while( (a=pgm_read_byte(txt)) ); // Wait for null char
While pgm_read_byte(txt) looks like a function call it is totally macro.
I don't believe this is a problem with the compiler at all, it did
exactly what it was told it could do.
--
David Kelly
the order.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org
My_Build_Date[] = The_Date_Is;
gcc already has a bluzillion predefined environment variables. I
wouldn't be surprised that one contains date and time stamp, lets check:
% touch foo.h ; avr-cpp -dM foo.h
Nope, didn't see a timestamp.
--
David Kelly N4HHE, [EMAIL PROTECTED
and wc, for EEprom and Working Copy, that its obvious ee.calibration
and wc.calibration are paired.
Initialization is easy because one only has to bulk copy ee into wc.
Is also practical to bulk copy wc into ee, but I selectively write my
updates as needed.
--
David Kelly N4HHE, [EMAIL
startup. Essentially all you have to do is create NULL
versions for Codevision or insert whatever special things Codevision
likes.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive
as there are many examples of avr-gcc code laying
around on the 'net for you to study. For instance, avr-libc.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
On Wed, Nov 09, 2005 at 09:00:58AM -0500, Dave Hansen wrote:
From: David Kelly [EMAIL PROTECTED]
[...]
People keep saying C isn't fast enough. I don't belive it. First
attempt:
[...]
It might be tough to do better on AVR. My standard SPI routine uses a
do-while loop, which might save
ret
Its not going to get much better than that.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
AVR
with unions and didn't see the
resulting advanced optimization.
The little difference was 3.4.3 would often emit two returns at the
end of a function where 3.4.4 only used one.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom
as
what avr-gcc does.
Also note the above is sensitive to machine endianess. Macintosh,
Sun, and Irix are big-endian.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
{
uint8_t lo, b, c, hi;
} u8;
struct {
int8_t lo, b, c, hi;
} i8;
} union32_t;
Easy enough to hack into whatever shape desired. The idea is to use
named members of a union rather than type casting and shifting.
--
David Kelly N4HHE, [EMAIL PROTECTED
supported within other major tools.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list mailing list
AVR-GCC-list
there is a chapter about Windows-
specific problems like this in the CVS book.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR
it was threaded
directly to the message I was talking about if anyone cares to go
read the message headers in the thread. And those who were already
tired of this thread would not be bothered.
--
David Kelly N4HHE, [EMAIL PROTECTED
for division or modulo and stores
the desired result. In assembly we could store both but I don't see
how to get at both from C. Is possible the compiler could optimize it
but plain -O didn't in recent tests.
--
David Kelly N4HHE, [EMAIL PROTECTED
1 - 100 of 113 matches
Mail list logo