Yahoo Groups archive

AVR-Chat

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

Thread

I cant get started

I cant get started

2005-12-20 by Ted Smith

Hi, I'm probably the oldest living active programmer in Australia and
have decided to have a go at AVRmega16's before I die - hopefully
using Bascom basic.
I have done a lot with VB6 and assembly with the old 6502's 25 years
ago but can't find anywhere any concise info on how to structure the
AVR programs and integrating the various sub-routines, interrupts etc.
It all seems so disjointed and every article I have found so is
written by someone who assumes I know what they know. (Like Microsoft
help screens of the past)
Can anyone point me to a good step by step starting guide on how to
compose a simple program to say accept a few switch inputs and output
to a few leds while displaying information from the EEprom on an LCD
depending on what switch is pressed?
With the old 6502 I would have used interrupt routines for the
switches and had a loop polling the inputs and simply written to
output port addresses with an indexed address looking up data
depending on the switch number.
I can't seem to rationalise this to the AVR or is it done another way?
Thanks Ted Smith

Re: [AVR-Chat] I cant get started

2005-12-20 by Don Ingram

Ted Smith wrote:
> Hi, I'm probably the oldest living active programmer in Australia and
> have decided to have a go at AVRmega16's before I die - hopefully
> using Bascom basic.
> I have done a lot with VB6 and assembly with the old 6502's 25 years
> ago but can't find anywhere any concise info on how to structure the
> AVR programs and integrating the various sub-routines, interrupts etc.
> It all seems so disjointed and every article I have found so is
> written by someone who assumes I know what they know. (Like Microsoft
> help screens of the past)
> Can anyone point me to a good step by step starting guide on how to
> compose a simple program to say accept a few switch inputs and output
> to a few leds while displaying information from the EEprom on an LCD
> depending on what switch is pressed?
> With the old 6502 I would have used interrupt routines for the
> switches and had a loop polling the inputs and simply written to
> output port addresses with an indexed address looking up data
> depending on the switch number.
> I can't seem to rationalise this to the AVR or is it done another way?
> Thanks Ted Smith 
> 
> 

Ted,

Can't help with Bascom but if you want to add a bit more to the challenge there 
is always C.  There is a good book doing the rounds of the tech colleges and 
uni's. "Embedded C Programming and the Atmel AVR" by Barnett, Cox, O'Cull. After 
assy C can't be that bad.

There is a good level of support from the WinAVR build of GCC for free and tons 
of people using it both privately and commercially.

I dislike C immensely but it pays the bills, having said this I disliked 
embedded basics even more so seeing as though there are few forth programmers 
left to be able to employ, C won as the best of the worst ;-)
( Potential candidate for "grumpy old men" )

Vague recollections of seeing my first calculator that didn't need a desk to 
hold it up and programming a 2650 via front panel toggle switches so we may not 
be that far apart.

-- 
Cheers

Don

Re: [AVR-Chat] I cant get started

2005-12-20 by Zack Widup

On Wed, 21 Dec 2005, Don Ingram wrote:

> 
> Ted,
> 
> Can't help with Bascom but if you want to add a bit more to the challenge
> there
> is always C.  There is a good book doing the rounds of the tech colleges
> and
> uni's. "Embedded C Programming and the Atmel AVR" by Barnett, Cox,
> O'Cull. After
> assy C can't be that bad.
> 

I need to get a copy od Smiley's book.  I understand it is also quite 
good.

All of my programming has been in assembler for the respective 
microcontrollers.  But you're right; C can't be that bad!  :-)

> There is a good level of support from the WinAVR build of GCC for free
> and tons
> of people using it both privately and commercially.
> 
> I dislike C immensely but it pays the bills, having said this I disliked
> embedded basics even more so seeing as though there are few forth
> programmers
> left to be able to employ, C won as the best of the worst ;-)
> ( Potential candidate for "grumpy old men" )
> 
> Vague recollections of seeing my first calculator that didn't need a desk
> to
> hold it up and programming a 2650 via front panel toggle switches so we
> may not
> be that far apart.
> 

One of the first computers I used was a DEC PDP-11 which we had to 
initiate by loading a bootloader with the toggles on the front, which 
then read our programs punched on reels of paper tape. The program 
gathered data at a field station and punched it on paper tape, which was 
taken back to a lab to be stored on magnetic tape by a G-20 computer (ever 
hear of those?)

Ah, the good old days ...

Zack

RE: [AVR-Chat] I cant get started

2005-12-20 by Larry Barello

The www.seattlerobotics.org/WorkshopRobot and my www.barello.net/ARC have a
suite of sample programs from very simple to relatively complex, that you
can use to get started.  WinAvr has some samples and a great FAQ that covers
many start-up issues with AVR & C.

Programming one CPU family is pretty much the same as another.  The
peripherals seem to be the biggest thing that changes.  The overall
architecture might affect how one structures assembly, but fortunately there
are pretty good C compilers for all modern chip sets - and you can learn a
lot from how the compiler assembles for a particular target.

Your example, below, would be trivial in C (not optimal for AVR, but don't
worry about that now):

char cMyTable[] = {0,1,2,3,...255}; // Put in your own numbers, of course
int main(void)
{
	DDRB = 0xFF;	// Port B output
	DDRD = 0x00;	// port D input, with pull-ups
	PORTD = 0xFF;

	while (1)
	{
		PORTB = cMyTable[PIND];
	}
}

Most AVRs have limited number of external interrupt lines.  Some of the
newer ones have "interrupt on pin change" which might work well for your
example.  Probably the simplest is to set up a periodic timer and poll from
there. You need to read the particulars for your compiler (BASCOM/WinAvr,
etc) to see how to set up the interrupt handler.  They are pretty simple
once you have a sample to look at.  The data sheets will have everything
else you need: register initialization & calculations needed to figure out
the interrupt rate.

Cheers!

-----------
Larry Barello
www.barello.net


| -----Original Message-----
| From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
| Of Ted Smith
| Sent: Tuesday, December 20, 2005 4:00 AM
| To: AVR-Chat@yahoogroups.com
| Subject: [AVR-Chat] I cant get started
| 
| Hi, I'm probably the oldest living active programmer in Australia and
| have decided to have a go at AVRmega16's before I die - hopefully
| using Bascom basic.
| I have done a lot with VB6 and assembly with the old 6502's 25 years
| ago but can't find anywhere any concise info on how to structure the
| AVR programs and integrating the various sub-routines, interrupts etc.
| It all seems so disjointed and every article I have found so is
| written by someone who assumes I know what they know. (Like Microsoft
| help screens of the past)
| Can anyone point me to a good step by step starting guide on how to
| compose a simple program to say accept a few switch inputs and output
| to a few leds while displaying information from the EEprom on an LCD
| depending on what switch is pressed?
| With the old 6502 I would have used interrupt routines for the
| switches and had a loop polling the inputs and simply written to
| output port addresses with an indexed address looking up data
| depending on the switch number.
| I can't seem to rationalise this to the AVR or is it done another way?
| Thanks Ted Smith

Re: [AVR-Chat] I cant get started

2005-12-20 by Jim Wagner

Try www.AVRBeginners.net.

Also www.AVRFreaks.net has lots of complete projects in
their archives.

Jim
---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

GCC-Avg and pure assembly

2005-12-20 by dlc@frii.com

Hi all,

  I've written code using the gcc-avr compiler in C for various projects,
but I have some code written for Tiny13 and Tiny11 chips that are
straight assembly. Has anyone written pure assembly using gcc-avr?  Can
we use just the assembler
to write code simply in the gcc-avr framework that can be downloaded to an
STK500 programmer board?  I've not checked to see if AVR-dude can handle
the "no ram" chips as well as the bigger chips...

thanks,
DLC
--
-------------------------------------------------
Dennis Clark
TTT Enterprises
-------------------------------------------------

Re: I cant get started

2005-12-20 by sm5glc

Ted,
if I understand you correctly you are fluent with VB and have a good
knowledge on how microprocessors works, you should have very few
problems getting the mega16 to do what you command :)

I am not a programmer myself but dabbling with BASCOM and find it a
very easy to get going. 

Download the manual at
http://www.mcselec.com/index.php?option=com_docman&task=cat_view&gid=99&Itemid=54
it describes in depth how BASCOM differes VB and how it works with the
AVR processors. Every command is accompanied with programming examples
/snippets  and you should get going in no time!

Take a few good hours to browse the manual and then try write a few
lines. The debugger is quite good and should help a lot! Just make
sure you have the debug switch set when compiling  for debug, and make
sure to REMove when compile for target.

Feel free to ask if you run into basic problems I'll try to help. The
more advanced stuff is not for me (not yet).

Cheers and Good Luck
/Lasse
--- In AVR-Chat@yahoogroups.com, "Ted Smith" <tedsmithau@y...> wrote:
Show quoted textHide quoted text
>
> Hi, I'm probably the oldest living active programmer in Australia and
> have decided to have a go at AVRmega16's before I die - hopefully
> using Bascom basic.
> I have done a lot with VB6 and assembly with the old 6502's 25 years
> ago but can't find anywhere any concise info on how to structure the
> AVR programs and integrating the various sub-routines, interrupts etc.
> It all seems so disjointed and every article I have found so is
> written by someone who assumes I know what they know. (Like Microsoft
> help screens of the past)
> Can anyone point me to a good step by step starting guide on how to
> compose a simple program to say accept a few switch inputs and output
> to a few leds while displaying information from the EEprom on an LCD
> depending on what switch is pressed?
> With the old 6502 I would have used interrupt routines for the
> switches and had a loop polling the inputs and simply written to
> output port addresses with an indexed address looking up data
> depending on the switch number.
> I can't seem to rationalise this to the AVR or is it done another way?
> Thanks Ted Smith
>

Re: [AVR-Chat] I cant get started

2005-12-20 by John Samperi

At 01:11 AM 21/12/2005, you wrote:
>  programming a 2650 via front panel toggle switches so we may not
>be that far apart.

Finally...another person that admits to having used the good
old signetic 2650.... :-)


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] I cant get started

2005-12-20 by John Samperi

zAt 11:00 PM 20/12/2005, you wrote:
>Hi, I'm probably the oldest living active programmer in Australia

Someone may challenge you :-)

>I have done a lot with VB6 and assembly with the old 6502's 25 years

Having used the 6502 you will find the AVR range very easy to use.
Don't listen to those that would try to win you to the DARK side of
C... :-) assembler is pretty easy to use, you will have a huge amount
of choice on how to do things compared to the 6502.

First of all have you downloaded and installed AVR Studio? The new
version will allow you even to use C (if "they" win) or just assembler.
Do you have an STK500 development kit? If not you can go to Jaycar and
get yourself a couple of Mega8535 (or the older 90S8535) a couple of
8MHz crystals and pop them on a bit of veroboard, a 5V supply and
you are set. You will get lots of help from this list...that's
provided you supply us with a truthful copy of your birth certificate
to verify that in fact you are as old as you claim to be ;-)

ps you will need to organize a programmer (obtainable also from Jaycar
or make it yourself) an STK500 makes it all too easy as everything you
will need is there and may be cheaper....not as much fun though.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] I cant get started

2005-12-20 by John Samperi

At 11:00 PM 20/12/2005, you wrote:
>have a go at AVRmega16's before I die - hopefully
>using Bascom basic.

oops I missed that :-)


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

RE: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by Larry Barello

I do that all the time: high speed encoders, or special low-latency
interrupt handlers in assembly (pure) using GAS (Gnu Assembler).  Read the
WinAvr GCC FAQ and look at the GAS manual.

The only restrictions, at the moment, is that if you want to do symbolic
debugging with the simulator you need to use .coff format and to get that to
work requires some magic in your assembly source.  Hopefully the next
release will have dwarf-2 debugging enabled in the assembler and the need
for magic will go away (hope, hope...)


-----------
Larry Barello
www.barello.net


| -----Original Message-----
| From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
| Of dlc@frii.com
| Sent: Tuesday, December 20, 2005 8:25 AM
| To: AVR-Chat@yahoogroups.com
| Subject: [AVR-Chat] GCC-Avg and pure assembly
| 
| Hi all,
| 
|   I've written code using the gcc-avr compiler in C for various projects,
| but I have some code written for Tiny13 and Tiny11 chips that are
| straight assembly. Has anyone written pure assembly using gcc-avr?  Can
| we use just the assembler
| to write code simply in the gcc-avr framework that can be downloaded to an
| STK500 programmer board?  I've not checked to see if AVR-dude can handle
| the "no ram" chips as well as the bigger chips...
| 
| thanks,
| DLC
| --
| -------------------------------------------------
| Dennis Clark
| TTT Enterprises
| -------------------------------------------------
| 
| 
| 
| 
| 
| 
| Yahoo! Groups Links
| 
| 
| 
| 
|

Re: [AVR-Chat] I cant get started

2005-12-21 by kelvin kooger

John,
By the way how old are you ? 50s or 60s ?

John Samperi wrote:
Show quoted textHide quoted text
zAt 11:00 PM 20/12/2005, you wrote:
>Hi, I'm probably the oldest living active programmer in Australia

Someone may challenge you :-)

>I have done a lot with VB6 and assembly with the old 6502's 25 years

Having used the 6502 you will find the AVR range very easy to use.
Don't listen to those that would try to win you to the DARK side of
C... :-) assembler is pretty easy to use, you will have a huge amount
of choice on how to do things compared to the 6502.

First of all have you downloaded and installed AVR Studio? The new
version will allow you even to use C (if "they" win) or just assembler.
Do you have an STK500 development kit? If not you can go to Jaycar and
get yourself a couple of Mega8535 (or the older 90S8535) a couple of
8MHz crystals and pop them on a bit of veroboard, a 5V supply and
you are set. You will get lots of help from this list...that's
provided you supply us with a truthful copy of your birth certificate
to verify that in fact you are as old as you claim to be ;-)

ps you will need to organize a programmer (obtainable also from Jaycar
or make it yourself) an STK500 makes it all too easy as everything you
will need is there and may be cheaper....not as much fun though.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: I cant get started (Zack)

2005-12-21 by Ted Smith

Ah yes, the old PDP11! I had forgotten!
I had some experience with one in 1978 when I worked at Channel 7. It
was purchased as the engine of a supposedly sutomatic presentation
controller (switching the commercials in on time automatically and
recording the events on a paper roll) but we never did get it to work
as well as a human and it was abandoned!
TV broadcasting is all so relatively simple these days with digital
video and huge data storage. Just about every piece of equipment has a
microcontroller in it.
Ted Smith
 
--- In AVR-Chat@yahoogroups.com, Zack Widup <w9sz@p...> wrote:
>
> > ( Potential candidate for "grumpy old men" )
> 
> One of the first computers I used was a DEC PDP-11 which we had to 
> initiate by loading a bootloader with the toggles on the front, which 
> then read our programs punched on reels of paper tape. The program 
> gathered data at a field station and punched it on paper tape, which
was 
> taken back to a lab to be stored on magnetic tape by a G-20 computer
(ever 
Show quoted textHide quoted text
> hear of those?)
> 
> Ah, the good old days ...
> 
> Zack
>

Re: I cant get started

2005-12-21 by jenalcom

--- In AVR-Chat@yahoogroups.com, "Ted Smith" <tedsmithau@y...> wrote:
>
> Hi, I'm probably the oldest living active programmer in Australia and
> have decided to have a go at AVRmega16's before I die - hopefully
> using Bascom basic.
> I have done a lot with VB6 and assembly with the old 6502's 25 years
> ago but can't find anywhere any concise info on how to structure the
> AVR programs and integrating the various sub-routines, interrupts etc.
> It all seems so disjointed and every article I have found so is
> written by someone who assumes I know what they know. (Like Microsoft
> help screens of the past)
> Can anyone point me to a good step by step starting guide on how to
> compose a simple program to say accept a few switch inputs and output
> to a few leds while displaying information from the EEprom on an LCD
> depending on what switch is pressed?
> With the old 6502 I would have used interrupt routines for the
> switches and had a loop polling the inputs and simply written to
> output port addresses with an indexed address looking up data
> depending on the switch number.
> I can't seem to rationalise this to the AVR or is it done another way?
> Thanks Ted Smith
>

Ted

There are only a few interrupts on the Atmel chips - not like some
processors that can have interrupts on all inputs.

Nobody has tried to suggest how you go about writing a programme (but
then that's a whole new ball game in it's self).

If you haven't already got some hardware then I suggest (as John S
did) that you get some strip board and a crystal and make something up
for your self.  These days I tend to use the spot board that Dick
Smith sells and use wire wrap wire to solder between points.  Put a 5v
regulator on the board and then you can power it with anything (within
reason!).

I also have a number of 10 pin IDC headers on the board, each one of
which is wired (pin for pin) to a port and then pin 9 is ground and 10
is +5v.   That way I can make up small daughter boards to plug into
the main board. The daughter boards can have LEDs, switches, RS232
driver, LCD connector, etc on them for flexibility.

For programming the chip a simple way is to use a parrallel port (if
you have one).  There are lots of circuits out there (one in the
Bascom Help Manual even) that can be used. I suggest you use one that
has the 74LS244 in the circuit rather than the simple programmer .
Look in the Help manual for ISP PROGRAMMER.

To start you on the way programming try putting a set of LEDs on port
B wired through a 2k2 resistor to ground and a set of switches on port A.

Set up port A as input with pull ups and port B as outputs.

Write a small loop programme that:

a) input PINA  ' gets switches
b) output PORTB  ' puts LEDS on/off
c) wait
d) goto back to a

Note that to read a pin or a port you have to use PINx while output
uses PORTx! I wish I had a dollar for every time I try and read using
PORTx instead of PINx!

There are several constructs for looping back.  FOR, DO-LOOP,
WHILE-WEND, GOTO, etc. All of which you will be familiar with. There
are several contructs of WAIT as well or you can use a timer, etc.

The important thing is that you cannot generally interrupt on a change
of a switch wired onto a port pin.  There are a couple of interrupt
pins that can be used though.

The start of you programme needs to 

a) declare all you variables, arrays, etc (see DIM inthe manual)
b) decalre and constants (see CONST)
c) set up your ports (see CONFIG)
d) set up any peripherals/timers (see CONFIG)
e) enable any interrups

Look at the sample programmes to get the idea.

Also the Bascom Forum ( at http://www.mcselec.com/) is a useful place
to visit.

HTH

Alan

Re: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by dlc

Bummer about the debugging - That comes in handy in AVR Studio when 
doing very time critical routines - I have several programs that are 
100% asm since there is no "RAM" in the little Tiny micros.

thanks,
DLC

Larry Barello wrote:
> I do that all the time: high speed encoders, or special low-latency
> interrupt handlers in assembly (pure) using GAS (Gnu Assembler).  Read the
> WinAvr GCC FAQ and look at the GAS manual.
> 
> The only restrictions, at the moment, is that if you want to do symbolic
> debugging with the simulator you need to use .coff format and to get that to
> work requires some magic in your assembly source.  Hopefully the next
> release will have dwarf-2 debugging enabled in the assembler and the need
> for magic will go away (hope, hope...)
> 
> 
> -----------
> Larry Barello
> www.barello.net
> 
> 
> | -----Original Message-----
> | From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
> | Of dlc@frii.com
> | Sent: Tuesday, December 20, 2005 8:25 AM
> | To: AVR-Chat@yahoogroups.com
> | Subject: [AVR-Chat] GCC-Avg and pure assembly
> | 
> | Hi all,
> | 
> |   I've written code using the gcc-avr compiler in C for various projects,
> | but I have some code written for Tiny13 and Tiny11 chips that are
> | straight assembly. Has anyone written pure assembly using gcc-avr?  Can
> | we use just the assembler
> | to write code simply in the gcc-avr framework that can be downloaded to an
> | STK500 programmer board?  I've not checked to see if AVR-dude can handle
> | the "no ram" chips as well as the bigger chips...
> | 
> | thanks,
> | DLC
> | --
> | -------------------------------------------------
> | Dennis Clark
> | TTT Enterprises
> | -------------------------------------------------
> | 
> | 
> | 
> | 
> | 
> | 
> | Yahoo! Groups Links
> | 
> | 
> | 
> | 
> | 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by Brian Dean

On Tue, Dec 20, 2005 at 09:24:49AM -0700, dlc@frii.com wrote:

>   I've written code using the gcc-avr compiler in C for various
> projects, but I have some code written for Tiny13 and Tiny11 chips
> that are straight assembly. Has anyone written pure assembly using
> gcc-avr?  Can we use just the assembler to write code simply in the
> gcc-avr framework that can be downloaded to an STK500 programmer
> board?

Yep, no problem.  Just remember that with a standalone pure assembly
program you need to fill certain things in that you don't need to
worry about when using C or BASIC or other high level language.  For
example, the interrupt vector table.  You gotta do this by hand.

> I've not checked to see if AVR-dude can handle the "no ram"
> chips as well as the bigger chips...

AVRDUDE doesn't care - it just downloads the given data to specified
memory.  It has no way of knowing whether you are downloading a valid
program or not.  In fact, when testing changes to AVRDUDE, I
frequently download ASCII byte patterns into flash and then use
terminal mode to dump sections of memory to make sure everything got
put where it should.

-Brian
-- 
Brian Dean
ATmega128 based MAVRIC controllers
http://www.bdmicro.com/

Re: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by dlc

Larry,

   I don't use WINAVR, I'm a Mac person and use just gcc-avr, there is 
no GAS in that distribution.  Is avr-as the same thing?  Or is there no 
debugger in the "generic" distribution?

thanks,
DLC

Larry Barello wrote:
> I do that all the time: high speed encoders, or special low-latency
> interrupt handlers in assembly (pure) using GAS (Gnu Assembler).  Read the
> WinAvr GCC FAQ and look at the GAS manual.
> 
> The only restrictions, at the moment, is that if you want to do symbolic
> debugging with the simulator you need to use .coff format and to get that to
> work requires some magic in your assembly source.  Hopefully the next
> release will have dwarf-2 debugging enabled in the assembler and the need
> for magic will go away (hope, hope...)
> 
> 
> -----------
> Larry Barello
> www.barello.net
> 
> 
> | -----Original Message-----
> | From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
> | Of dlc@frii.com
> | Sent: Tuesday, December 20, 2005 8:25 AM
> | To: AVR-Chat@yahoogroups.com
> | Subject: [AVR-Chat] GCC-Avg and pure assembly
> | 
> | Hi all,
> | 
> |   I've written code using the gcc-avr compiler in C for various projects,
> | but I have some code written for Tiny13 and Tiny11 chips that are
> | straight assembly. Has anyone written pure assembly using gcc-avr?  Can
> | we use just the assembler
> | to write code simply in the gcc-avr framework that can be downloaded to an
> | STK500 programmer board?  I've not checked to see if AVR-dude can handle
> | the "no ram" chips as well as the bigger chips...
> | 
> | thanks,
> | DLC
> | --
> | -------------------------------------------------
> | Dennis Clark
> | TTT Enterprises
> | -------------------------------------------------
> | 
> | 
> | 
> | 
> | 
> | 
> | Yahoo! Groups Links
> | 
> | 
> | 
> | 
> | 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

Re: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by Brian Dean

On Tue, Dec 20, 2005 at 09:22:58PM -0700, dlc wrote:

>    I don't use WINAVR, I'm a Mac person and use just gcc-avr, there is
> no GAS in that distribution.  Is avr-as the same thing?  Or is there no
> debugger in the "generic" distribution?

That's gas - avr-as is the gnu assembler for the avr target.

-Brian
-- 
Brian Dean
ATmega128 based MAVRIC controllers
http://www.bdmicro.com/

Re: [AVR-Chat] I cant get started

2005-12-21 by John Samperi

At 11:56 AM 21/12/2005, you wrote:
>John,
>By the way how old are you ? 50s or 60s ?

54 :-) now everybody knows.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

RE: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by Larry Barello

Read the FAQ.  The sample makefile that comes with WinAvr should work fine
with the mac.  You can also look at the man pages for GCC.  something like
avr-gcc -c -mmcu=$(MCU) -I. -x assembler-with-cpp
-Wa,-adhlns=$(<:.S=.lst),-gstabs <yourfile.S> -o <yourfile.o>

should do the job.  The magic lines of code are

	.section .text,"ax","progbits"
	.stabs  "",100,0,0,InitEncoders
	.stabs  "EncoderAsm.s",100,0,0,InitEncoders

In the example, above, the first routine is "InitEncoders" and the file,
is "EncodersAsm.s"  As far as I know the rest is boilerplate and once
defined (near the top of your file) text symbols will be available for the
entire file.  No data symbols, however.  You are still stuck using the map.

-----------
Larry Barello
www.barello.net


| -----Original Message-----
| From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
| Of dlc
| Sent: Tuesday, December 20, 2005 8:23 PM
| To: AVR-Chat@yahoogroups.com
| Subject: Re: [AVR-Chat] GCC-Avg and pure assembly
| 
| Larry,
| 
|    I don't use WINAVR, I'm a Mac person and use just gcc-avr, there is
| no GAS in that distribution.  Is avr-as the same thing?  Or is there no
| debugger in the "generic" distribution?
| 
| thanks,
| DLC
| 
| Larry Barello wrote:
| > I do that all the time: high speed encoders, or special low-latency
| > interrupt handlers in assembly (pure) using GAS (Gnu Assembler).  Read
| the
| > WinAvr GCC FAQ and look at the GAS manual.
| >
| > The only restrictions, at the moment, is that if you want to do symbolic
| > debugging with the simulator you need to use .coff format and to get
| that to
| > work requires some magic in your assembly source.  Hopefully the next
| > release will have dwarf-2 debugging enabled in the assembler and the
| need
| > for magic will go away (hope, hope...)
| >
| >
| > -----------
| > Larry Barello
| > www.barello.net
| >
| >
| > | -----Original Message-----
| > | From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
| Behalf
| > | Of dlc@frii.com
| > | Sent: Tuesday, December 20, 2005 8:25 AM
| > | To: AVR-Chat@yahoogroups.com
| > | Subject: [AVR-Chat] GCC-Avg and pure assembly
| > |
| > | Hi all,
| > |
| > |   I've written code using the gcc-avr compiler in C for various
| projects,
| > | but I have some code written for Tiny13 and Tiny11 chips that are
| > | straight assembly. Has anyone written pure assembly using gcc-avr?
| Can
| > | we use just the assembler
| > | to write code simply in the gcc-avr framework that can be downloaded
| to an
| > | STK500 programmer board?  I've not checked to see if AVR-dude can
| handle
| > | the "no ram" chips as well as the bigger chips...
| > |
| > | thanks,
| > | DLC
| > | --
| > | -------------------------------------------------
| > | Dennis Clark
| > | TTT Enterprises
| > | -------------------------------------------------
| > |
| > |
| > |
| > |
| > |
| > |
| > | Yahoo! Groups Links
| > |
| > |
| > |
| > |
| > |
| >
| >
| >
| >
| >
| >
| > Yahoo! Groups Links
| >
| >
| >
| >
| >
| >
| >
| 
| --
| -------------------------------------------------
| Dennis Clark          TTT Enterprises
| www.techtoystoday.com
| -------------------------------------------------
| 
| 
| 
| 
| Yahoo! Groups Links
| 
| 
| 
| 
|

RE: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by dlc@frii.com

Thanks Larry and Brian.  I'm still on my quest to liberate myself from the
PC entirely.  Sadly, while it can be mostly done, it just isn't that easy!

happy holidays,
DLC
Show quoted textHide quoted text
> Read the FAQ.  The sample makefile that comes with WinAvr should work fine
> with the mac.  You can also look at the man pages for GCC.  something like
> avr-gcc -c -mmcu=$(MCU) -I. -x assembler-with-cpp
> -Wa,-adhlns=$(<:.S=.lst),-gstabs <yourfile.S> -o <yourfile.o>
>
> should do the job.  The magic lines of code are
>
> 	.section .text,"ax","progbits"
> 	.stabs  "",100,0,0,InitEncoders
> 	.stabs  "EncoderAsm.s",100,0,0,InitEncoders
>
> In the example, above, the first routine is "InitEncoders" and the file,
> is "EncodersAsm.s"  As far as I know the rest is boilerplate and once
> defined (near the top of your file) text symbols will be available for the
> entire file.  No data symbols, however.  You are still stuck using the
> map.
>
> -----------
> Larry Barello
> www.barello.net
>
>
> | -----Original Message-----
> | From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
> Behalf
> | Of dlc
> | Sent: Tuesday, December 20, 2005 8:23 PM
> | To: AVR-Chat@yahoogroups.com
> | Subject: Re: [AVR-Chat] GCC-Avg and pure assembly
> |
> | Larry,
> |
> |    I don't use WINAVR, I'm a Mac person and use just gcc-avr, there is
> | no GAS in that distribution.  Is avr-as the same thing?  Or is there no
> | debugger in the "generic" distribution?
> |
> | thanks,
> | DLC
> |
> | Larry Barello wrote:
> | > I do that all the time: high speed encoders, or special low-latency
> | > interrupt handlers in assembly (pure) using GAS (Gnu Assembler).  Read
> | the
> | > WinAvr GCC FAQ and look at the GAS manual.
> | >
> | > The only restrictions, at the moment, is that if you want to do
> symbolic
> | > debugging with the simulator you need to use .coff format and to get
> | that to
> | > work requires some magic in your assembly source.  Hopefully the next
> | > release will have dwarf-2 debugging enabled in the assembler and the
> | need
> | > for magic will go away (hope, hope...)
> | >
> | >
> | > -----------
> | > Larry Barello
> | > www.barello.net
> | >
> | >
> | > | -----Original Message-----
> | > | From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
> | Behalf
> | > | Of dlc@frii.com
> | > | Sent: Tuesday, December 20, 2005 8:25 AM
> | > | To: AVR-Chat@yahoogroups.com
> | > | Subject: [AVR-Chat] GCC-Avg and pure assembly
> | > |
> | > | Hi all,
> | > |
> | > |   I've written code using the gcc-avr compiler in C for various
> | projects,
> | > | but I have some code written for Tiny13 and Tiny11 chips that are
> | > | straight assembly. Has anyone written pure assembly using gcc-avr?
> | Can
> | > | we use just the assembler
> | > | to write code simply in the gcc-avr framework that can be downloaded
> | to an
> | > | STK500 programmer board?  I've not checked to see if AVR-dude can
> | handle
> | > | the "no ram" chips as well as the bigger chips...
> | > |
> | > | thanks,
> | > | DLC
> | > | --
> | > | -------------------------------------------------
> | > | Dennis Clark
> | > | TTT Enterprises
> | > | -------------------------------------------------
> | > |
> | > |
> | > |
> | > |
> | > |
> | > |
> | > | Yahoo! Groups Links
> | > |
> | > |
> | > |
> | > |
> | > |
> | >
> | >
> | >
> | >
> | >
> | >
> | > Yahoo! Groups Links
> | >
> | >
> | >
> | >
> | >
> | >
> | >
> |
> | --
> | -------------------------------------------------
> | Dennis Clark          TTT Enterprises
> | www.techtoystoday.com
> | -------------------------------------------------
> |
> |
> |
> |
> | Yahoo! Groups Links
> |
> |
> |
> |
> |
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>

Re: [AVR-Chat] GCC-Avg and pure assembly

2005-12-21 by Thomas Keller

dlc@frii.com wrote:

><html><body>
>Mime-Version: 1.0
>Content-Type: multipart/mixed; boundary="=======AVGMAIL-43A9AC0D751E======="
>  
>
    ***ACK***   *PLEASE* do not post HTML in here!

tom

Re: [AVR-Chat] I cant get started

2005-12-21 by Thomas Keller

Ted Smith wrote:

> Hi, I'm probably the oldest living active programmer in Australia and
> have decided to have a go at AVRmega16's before I die -


   Well, don't die anytime soon, OK!??

>                                                               hopefully
> using Bascom basic.


   *BOO*  *HISS*   (I am MOST unimpressed with this package)

[excess text deleted for brevity]

> Can anyone point me to a good step by step starting guide on how to
> compose a simple program to say accept a few switch inputs and output
> to a few leds while displaying information from the EEprom on an LCD
> depending on what switch is pressed?


   Check out the applications notes on www.atmel.com.   There are a 
number which deal with exactly this sort of thing.  Chevck out also 
www.avrfreaks.org, they  have hundreds of AVR projects, many f which are 
exactly the sorts of things you are looking for.

  Welcome to the world of AVR!

tom

Re: [AVR-Chat] I cant get started

2005-12-21 by Thomas Keller

John Samperi wrote:

> At 11:56 AM 21/12/2005, you wrote:
> >John,
> >By the way how old are you ? 50s or 60s ?
>
> 54 :-) now everybody knows.
>
  Aww...that ain't *OLD*.  Hell, *I* am 53.

tom

Re: [AVR-Chat] I cant get started

2005-12-21 by Jim Wagner

65, here.

Jim

On Wed, 21 Dec 2005 13:47:55 -0600
 Thomas Keller <tkeller1@neb.rr.com> wrote:
> John Samperi wrote:
> 
> > At 11:56 AM 21/12/2005, you wrote:
> > >John,
> > >By the way how old are you ? 50s or 60s ?
> >
> > 54 :-) now everybody knows.
> >
>   Aww...that ain't *OLD*.  Hell, *I* am 53.
> 
> tom
> 
> 
> ------------------------ Yahoo! Groups Sponsor
> --------------------~--> 
> Most low income homes are not online. Make a difference
> this holiday season!
> http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/dN_tlB/TM
>
--------------------------------------------------------------------~->
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 

---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

Re: [AVR-Chat] I cant get started

2005-12-21 by Zack Widup

On Wed, 21 Dec 2005, Thomas Keller wrote:

> John Samperi wrote:
> 
> > At 11:56 AM 21/12/2005, you wrote:
> > >John,
> > >By the way how old are you ? 50s or 60s ?
> >
> > 54 :-) now everybody knows.
> >
>   Aww...that ain't *OLD*.  Hell, *I* am 53.
> 
> tom

I am also 53.  My first contact with computers was in 1973 (IBM 360, DEC 
10, PDP-11). By today's standards they were monsters back then, even the 
PDP-11. I remember a buddy getting a free sample of the Intel 8008 back 
in the mid-70's.

My first microcontroller project was with a Z-80.  I wrote the program in 
assembler and converted it to machine code by hand using the Z-80 handbook 
and programmed it into a SEEQ 52B13 (which is an EEPROM using 5 volts as 
the programming voltage) using DIP switches and pushbuttons. I was amazed 
that it worked!

I guess we've come a long ways since then.  :)

Zack

Re: [AVR-Chat] I cant get started

2005-12-22 by Russell Shaw

Jim Wagner wrote:
> 65, here.
> 
> Jim

35.
But i got asked *twice* for ID yesterday when
buying alcoholic stuff for xmas at two places.

Re: I cant get started

2005-12-22 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, Zack Widup <w9sz@p...> wrote:
> My first contact with computers was in 1973 (IBM 360, DEC 
> 10, PDP-11).

My first programming was in the early 70's on an IBM 1620 - FORTRAN IV 
on punch card input.  As a graduate student in the mid-70s, I taught a 
senior level Electrical Engineering lab where we used Intel's Intellec 
8 (8008 based).  In the second year, we upgraded to the Mod 80 (8080 
based) version.  Both of these machines required you to enter a "jump 
to monitor" instruction from the front panel to boot them up (c8 00 e0 
or some such).  Then, you could use the Load command to read in a 
paper tape with the object code of the program.

Don
ZBasic Microcontrollers
http://www.zbasic.net

Re: I cant get started

2005-12-23 by scmikes03

Ted,

I am also new.  I was in the same boat as you.

I would recommend going to the Smiley site:

http://smileymicros.com/

If you drop ~$80 US dollars you get

- Butterfly Board from atmel
- Project Kit
- Book that guides you step by step though
   - development environment setup
   - a number of fun projects that have all required 
     parts in the kit.


Just starting out in something, it is nice to have
step-by-step recipies to follow (and the hardware
to execute them:-).  You get it all in this package.

Have fun, and welcome.

Mike


--- In AVR-Chat@yahoogroups.com, "Ted Smith" <tedsmithau@y...> wrote:
Show quoted textHide quoted text
>
> Hi, I'm probably the oldest living active programmer in Australia and
> have decided to have a go at AVRmega16's before I die - hopefully
> using Bascom basic.
> I have done a lot with VB6 and assembly with the old 6502's 25 years
> ago but can't find anywhere any concise info on how to structure the
> AVR programs and integrating the various sub-routines, interrupts etc.
> It all seems so disjointed and every article I have found so is
> written by someone who assumes I know what they know. (Like Microsoft
> help screens of the past)
> Can anyone point me to a good step by step starting guide on how to
> compose a simple program to say accept a few switch inputs and output
> to a few leds while displaying information from the EEprom on an LCD
> depending on what switch is pressed?
> With the old 6502 I would have used interrupt routines for the
> switches and had a loop polling the inputs and simply written to
> output port addresses with an indexed address looking up data
> depending on the switch number.
> I can't seem to rationalise this to the AVR or is it done another way?
> Thanks Ted Smith
>

Re: [AVR-Chat] Re: I cant get started

2005-12-26 by massimo banzi

Sorry to jump in so late in the thread


One option is to use this opensource platform I've worked on
with a bunch of other people

it's called arduino (http://arduino.cc). it works with an atmega8
our manufacturer sells a single usb board for 20EUR plus shippping
but all the eagle cad files are provided if you want to make your own

it can also be used in a breadboard following the instructions
written by tom igoe from nyu
http://arduino.berlios.de/index.php/Main/StandaloneAssembly

The ide is written in Java and works on all major platforms and
the language is basically c with all the complications taken away

when you compile, your code is turned into c and compiled
with avr-gcc. when you get familiar with c you can start
going straight into the language.

jsut to give you a reference I'll cut and paste the classic led
blink example


int ledPin = 13;                 // LED connected to digital pin 13

void setup()                    // this is where you setup the pins etc
{
   pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()                     // by convention loop is executed  
forever
{
   digitalWrite(ledPin, HIGH);   // sets the LED on
   delay(1000);                  // waits for a second
   digitalWrite(ledPin, LOW);    // sets the LED off
   delay(1000);                  // waits for a second
}


I use it to teach designers about microcontrollers so it must be
super simple because they don't have any background in programming
or technology

massimo
Show quoted textHide quoted text
On Dec 23, 2005, at 7:16 AM, scmikes03 wrote:

> Ted,
>
> I am also new.  I was in the same boat as you.
>
> I would recommend going to the Smiley site:
>
> http://smileymicros.com/
>
> If you drop ~$80 US dollars you get
>
> - Butterfly Board from atmel
> - Project Kit
> - Book that guides you step by step though
>    - development environment setup
>    - a number of fun projects that have all required
>      parts in the kit.
>
>
> Just starting out in something, it is nice to have
> step-by-step recipies to follow (and the hardware
> to execute them:-).  You get it all in this package.
>
> Have fun, and welcome.
>
> Mike
>
>
> --- In AVR-Chat@yahoogroups.com, "Ted Smith" <tedsmithau@y...> wrote:
>
>>
>> Hi, I'm probably the oldest living active programmer in Australia and
>> have decided to have a go at AVRmega16's before I die - hopefully
>> using Bascom basic.
>> I have done a lot with VB6 and assembly with the old 6502's 25 years
>> ago but can't find anywhere any concise info on how to structure the
>> AVR programs and integrating the various sub-routines, interrupts  
>> etc.
>> It all seems so disjointed and every article I have found so is
>> written by someone who assumes I know what they know. (Like Microsoft
>> help screens of the past)
>> Can anyone point me to a good step by step starting guide on how to
>> compose a simple program to say accept a few switch inputs and output
>> to a few leds while displaying information from the EEprom on an LCD
>> depending on what switch is pressed?
>> With the old 6502 I would have used interrupt routines for the
>> switches and had a loop polling the inputs and simply written to
>> output port addresses with an indexed address looking up data
>> depending on the switch number.
>> I can't seem to rationalise this to the AVR or is it done another  
>> way?
>> Thanks Ted Smith
>>
>>
>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor -------------------- 
> ~-->
> Get Bzzzy! (real tools to help you find a job). Welcome to the  
> Sweet Life.
> http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/dN_tlB/TM
> -------------------------------------------------------------------- 
> ~->
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

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.