In the electrical diagram (and also in the EAGLE gerber files) the A4/SCL and A4/SDA pins are each connected to two pins of the micro, namely A4 with PF02 and PA02, and A5 with PF03 and PA03. This seems very strange, perhaps a design error?
Regardless, I wanted to use A5 as a digital output; in the setup I declared A5 as output with the pinMode() function and everything works as expected: digitalWrite() does its duty. However, since the digitalWrite() function is very slow, I replaced it with the PORTF.OUTSET and PORTF.OUTCLR functions, and again everything works as it should; but if instead of using port F I turn to port A, pin A5 always remains at 0. How do you explain all this?
Furthermore, I observe that in Arduino15\packages\arduino\hardware\megaavr\1.8.8\variants\nona4809\pins_arduino.h it seems that A5 is connected only to PF3 (in the line #define PIN_A5 (19) // PF3 / AIN13), while in the datasheet (at point 6 - connector pinout) it is stated that A5 is connected to PA3. There is clearly some confusion.
Since I first tried to raise A5 with the command PORTA.OUTSET=PIN3_bm, but pin A5 did not raise, have I created a conflict (potentially destructive for the gates in question) with PF3?
What inhibits port A when port F is active?
Thanks to anyone who can clarify.
1 post - 1 participant