Hi, friends, thanks for your time!
What I'm doing is reading the high nibble of a port, the low nibble its rotating, so the port its working as an input and as an output.
The code:
#include#include int main(void) { //DDRB = 0X0F; DDRB = 0x0f; volatile uint8_t FlagA = 0; PORTB = 0x01; while(1) { if(FlagA == 0) { PORTB = PORTB; FlagA = 1; } else { PORTB = (PORTB << 1); } _delay_ms(100); if (PORTB == 0x08) { PORTB = 0x01; FlagA = 0; } switch(PINB) { case 0b0001xxxx: break; } } }
using STK600 and a Atmega2560.
I want to know if there is any changes in high nibble.
I know that the xxxx dont go there, what I mean with the Xs its that I dont care the low nibble, I just wrote it that way so I can better explain the case.
Thanks again!
Hope you have some ideas!
Alex.