Yahoo Groups archive

AVR-Chat

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

Message

RE: [AVR-Chat] outp PORT= etc confusion

2003-12-15 by Larry Barello

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
only supported for legacy code.  In fact if you do operations on ports and
the compiler will pick the best way to implement.  For example

PORTB |= (1<<PB4);

will turn into a bit set instruction.

You might consider BASCOM: it is a basic compiler, so you can preserve your
basic stamp knowledge, but get a 10,000x faster execution.  It isn't as good
as C, but it is still pretty good.

Cheers!

-----Original Message-----
From: Adrian [mailto:adrian650@yahoo.com]

I'm new to the list having decided I wanted the speed
of a native AVR rather than easy front end of STAMP/BX
etc. So far I'm having trouble (I did program in C a
decade ago...).

I'm having trouble with IO and found the documentation
confusing. Shoudl I be using outp or can I use
DDRD=0xff and PORTB=0xwhatever?

Also, if I want to read pins am I right to use
incoming=PINB?

BTW, anyone got ready-made code for 6963LCD driver?
I'm rewriting a BX24 code I did that was too slow.

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.