-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The mysteries about PE4 PE5 PE6 #174
Comments
It's really mysterious. I'll try solve it, both with 328P and 328D when I have more free time. |
Not yet tested, but
Edit:
|
Dunno if this helps, but with direct port manipulation I can read in E4 and E5 just fine when using the LQFP32 option:
|
My first thought about of error was not good above because:
But I found a typing error in merge request #36 digital_pin_to_bit_mask_PGM[] section
only the remark was changed not the bit field. |
Unrelated but while talking about typos: There is more typos a few lines before in the the comments:
This should count up to 39, shouldn't it? |
Yes, a beauty bug. :) |
Tested with
But in case of 328D, the lgt8fx package not disabling AREF when setting pin mode for E6, and not disabling SWD + SWC when setting pin mode E0 or E2. It needs to be corrected later. |
Is this issue also resolved by #185 ? |
I want to use PE4 and PE5 in my sketch (knowing that these are not exposed on regular LGT boards with LQFP32 package, but I have a custom board). After @jayzakk made PE6 available as A10 via #36 I was curious if one could also use PE4 and PE5 even without "official" Ax naming etc. Checking
pin_arduino.h
everything should be there. Here is what I did:Running this the console prints the internal "port number" (?) and then continuously prints 1, when shorting the relevant pins to GND I should see the console printing 0. So far so good.
If compile it with the LQFP32 option I get the following:
E4 (prints 24), works
E5 (prints 26), doest not work
E6 (prints 25), works but not on AREF pin but on PE5 (huh?!)
A10 is equivalent to E6
On the other hand, if I compile it with LQFP48 get the following:
E4 (prints 31), works
E5 (prints 32), works
E6 (prints 25), works (on AREF as expected)
A10 is equivalent to E6
Can anyone shed some light on this? Despite the different "port number" (?) when printing, the bit field (
_BV()
) points to the same bits on the PORTE inpin_arduino.h
on both options. So from my understanding this should work with LQFP32 option as well, but it does not. Please help. :)PS: The analog read on A10/AREF (see #36) works with both, it's just when you want to use these as GPIOs something looks mixed up.
The text was updated successfully, but these errors were encountered: