DPRG
DPRG List  



[DPRG] Reading ATMEGA8 ports using WINAVR

Subject: [DPRG] Reading ATMEGA8 ports using WINAVR
From: DeltaGraph at aol.com DeltaGraph at aol.com
Date: Thu Sep 9 12:01:31 CDT 2004

Kip,
Bits that you configure for output will generate same results PORTC and PINC,
but bits that are configured for input should rely on PINC to read.

PORTC will reflect the state of the latched output bits even if disconnected 
from the output by setting DDRC bits to "0" (for input).

Pretty sure about this.


One other thing to watch for on some of the other chips like MEGA 16/32 is to 
disable JTAG if using bits shared by JTAG interface - done by writing to the 
fuse registers -- at least one method.

Also, another killer for me was to reuse old code and forget to disable init 
code that sets special modes, e.g. I forgot that I set up for  PWM  output, 
then had weird things happening to me when writing to bits -- as I recall. 

Unfortunately I am not one of those real ultra-methodical engineer types so 
take everything that I say with a grain of  salt.

Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.dprg.org/pipermail/dprglist/attachments/20040909/9b6758ba/attachment.html

More information about the DPRG mailing list