n)
{
return( pgm_read_byte(PSTR(0123456789ABCDEF)+(n0xf)) );
}
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC
++;
}
}
--
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/mailman
use the copy of tail already in its registers and write only
after it has no more use of it.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
On Aug 14, 2005, at 4:21 AM, Bob Paddock wrote:
On Saturday 13 August 2005 08:35 pm, David Kelly wrote:
For advanced discussion one would probably wish to put the buffer and
its indexes into a struct so that its obvious to future generations
maintaining your code that the indexes and buffer
Wouldn't it be easier to simply define the size like this:
#define myQ_SIZE(16)
If you shift a 1 then it must be a power of 2.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
have to know what it is sorting or how it is being ordered, the
comparison function is expected to know. A callback routine by any
other name.
Yes, the docs say qsort() sorts in ascending order, but if the
comparison function inverts its reply then the order is descending.
--
David Kelly N4HHE
due to the different
function prototypes.
Unix is putc(char, FILE*) so I think the put() function in avr-libc
should be same.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad
the contents must be accessed.
I don't much care about the order of my eeprom variables, but
everything in eeprom is named with an ee_ prefix.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first
to address decoders.
Never observed any warming of these parts.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy, they must first drive mad.
___
AVR-GCC-list
AVR C compilers do better.
There are at least 3 address spaces in the AVR: SRAM, FLASH, and
EEPROM. Maybe SFR is 4th but think that is in SRAM space.
--
David Kelly N4HHE, [EMAIL PROTECTED]
Whom computers would destroy
On Sep 18, 2005, at 5:33 PM, Vincent Trouilliez wrote:
On Sun, 2005-09-18 at 16:54 -0500, David Kelly wrote:
...I don't use printf() so I haven't used printf_P()
But how do you do then ?
If you wrote better functions, please share ! :-)
Printf takes huge space, so if you have a light
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
On Mon, Sep 19, 2005 at 05:46:52PM +0200, Vincent Trouilliez wrote:
On Mon, 2005-09-19 at 07:33 -0500, David Kelly wrote:
Your putchar() (or whatever) writes to an LCD? So how long does it
take to latch a character into the LCD?
Yep I print to standard text LCD module (4x20), it takes about
that routine so we can get at both dividend and remainder using
a struct. The exact same primative is used for division and modulo, the
only difference is which result is picked up.
Might be nice to add a udiv() and uldiv() to existing div() and ldiv().
--
David Kelly N4HHE, [EMAIL PROTECTED
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
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
{
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
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
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
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
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
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
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
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
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
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
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
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
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
, 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
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
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
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
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
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
-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
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
/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
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
;
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
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
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
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
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
(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
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
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
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
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
, 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
. 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
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
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
. 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
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
, 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
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
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
;
struct {
uint8_t a;
uint16_tbc;
} little_big;
struct {
uint8_t a, b, c;
} byte;
} MY24BITS;
--
David Kelly N4HHE, [EMAIL PROTECTED
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
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
.
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
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 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
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
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
;
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
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
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
-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
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
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
. 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
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
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
.
--
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
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
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
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
1 - 100 of 113 matches
Mail list logo