Hi all,
I must be missing something very simple here. I've got an Atmega128 hooked up on my STK600. PORTA is connected to the LED's. Nothing else is connected. For some reason setting other ports to output in an external function seems to screw things up.
first LED off = YIPEE!
first LED on = WTF?!?
Code:
#include <avr/io.h>
// function prototype(s)
void initializeDisplay(void);
int main(void) {
initializeDisplay();
PORTA = 0x01;
}
void initializeDisplay(void) {
DDRA = 0xff;
// DDRB = 0xff;
}
= YIPEE!
Code:
#include <avr/io.h>
// function prototype(s)
void initializeDisplay(void);
int main(void) {
initializeDisplay();
PORTA = 0x01;
}
void initializeDisplay(void) {
DDRA = 0xff;
DDRB = 0xff;
}
= WTF?!?
Code:
#include <avr/io.h>
int main(void) {
DDRA = 0xff;
DDRB = 0xff;
PORTA = 0x01;
}
= YIPEE!
Hurrrr? |