Yahoo Groups archive

AVR-Chat

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

Message

More newbie questions- MAP file and char vs int

2003-12-17 by Adrian

Larry,

> Yes, DDRx  is the direction register, PORTx is the
> output driver (or
> pull-ups) and PINx is the current state of the pin
> (regardless of whether it
> is input or output or if the output is driven high
> while the corresponding
> PORT bit is low, etc).  Direct assignment works with
> GCC - outp is old and
Thanks for confirming that.


> You might consider BASCOM: it is a basic compiler,
> so you can preserve your
I tried that in the demo form and my LCD code didn't
work (but see below) hence the move to WinAVR GCC. I
liked the BASCOM IDE, but WinAVR worked for me very
quickly (i was quite surprised) and in combination
with Studio and AVRISP it's not too bad switching
between applications.

I have discovered that my 'problem' was that the AVR
instruction time is too short for the LCD - that takes
150ns between CE low and the data bus being ready for
read - GCC must be making it single cycle instructions
as I've had to put a delay between CE and read to get
it in.

> basic stamp knowledge, but get a 10,000x faster
More importantly the BASCOM code was BIG. I didn't
look at the disassembly but it was using 70% of a 2313
just for the basic driver code - there's no way my
application would have got in too. GCC code is around
300 bytes (not words if I have read HEX file
correctly). Maybe they put in a bigger start-up
library?

On such a little device as the 2313 it is nice to be
able to access memory via arrays to implement string
functions simply and economically. BASIC hides that.

That brings me to the MAP. The STAMP has a really nice
graphic map to show program, constant and variable
consumption of resources. Can anyone explain how this
can be extracted from map file?

Whilst on resources, I've seen that a number of
example.c files define routines and variables as INT
even thoughnthey are clearly only 8 bits wide. Why
aren't they done as CHAR? Even if they are allocated
dynamically it's still taking more space than needed
and could add confusion if trying to force an INT into
a 8bit PORT.

TIA,

Adrian


=====
-
*********************************************

________________________________________________________________________
BT Yahoo! Broadband - Save £80 when you order online today. Hurry! Offer ends 21st December 2003. The way the internet was meant to be. http://uk.rd.yahoo.com/evt=21064/*http://btyahoo.yahoo.co.uk

Attachments

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.