I have the weirdest fault i have ever seen.
I have a new PCB that has some BCD switches connected to PORTC. I have 8 LEDs on PORTA and I am writing some simple code to check the hardware.
#include#include int main (void) { // port 'A' DDRA = 0xff; PORTA = 0x00; // port 'B' DDRB = 0xff; PORTB = 0x00; // port 'C' DDRC = 0x00; PORTC = 0xff; // port 'D' DDRD = 0x00; PORTD = 0xff; while(1) PORTA = PINC; }
In this case PA2, PA3 PA4 & PA5 are always OFF ( LO)
IE PA0, PA1 PA6 and PA7 work as expected.
I have done the following:
Replaced chip with new one
turned on all PORTA , ignoring PINC
Buzzed out PWB to see if there were any stupid track faults
Tried another Board without switches fitted and tried manipulating the M16 legs
used PortB as Output
Pulled most my remaining hair
If I change code to read Port B and manipulate the pins, PortA follows PotrB.
Any suggestions what I have missed?
TIA
Matt