I have been working on a school project using an ATmega324p and I have never experienced this error before.
I am trying to use 2 consecutive bits like PC3 and PC4 as an output and to accomplish that i use the DDRC|=(1<<PC3)|(1<<PC4); then i want the PC3 to have "0" and the PC4 to have "1" and i do PORTC|=(1<<PC4); PORTC&=(0<<PC3);. Until this point everything is fine but when i check the logical state on both pins, they have both the LOW level (0).
I have already disabled the JTAG fuse bit, I've tried to use an other port and the same thing happens when using the port A, for example. I've already changed my ATmega to a new one, configured the fuse bit all over again (because I'm running it at 16MHz using an external crystal) and the same thing still happen.
I already tried to send information using for example PORTC=0b11110111 and it works just fine, but I can use that method because I want to manipulate pin by pin.
Can someone help with this situation? I have already used an ATmega88 and 128p and it never happened.
Many thanks for you attention in advance and happy new year!