False Alarm:   Bug?: Arduino IDE 2.0.3 using Nano A3 - Page 1
Forum section: electronics / general

author: CDN_Torsten
author_rank: Regular Contributor
timestamp: January 22, 2023, 02:04:47 pm
content: I think I may have found a bug in the latest Arduino IDE(2.0.3) when using A3 as a digital input on the Nano.I'm reading switches with an external pull-up to 5V.A0, A1, A2, A4, and A5 work correctly with:digitalRead(A#)For some reason A3 does not work with digitalRead(A3) - it outputs a 0 constantly.Using A3 with analogRead(A3) works as expected.Has anyone else seen this??

author: Lindley
author_rank: Regular Contributor
timestamp: January 22, 2023, 05:00:41 pm
content: Does using digitalRead(17) work on pin A3 ?

author: ozcar
author_rank: Frequent Contributor
timestamp: January 22, 2023, 08:06:10 pm
content: I have been carefully avoiding going anywhere near the new IDE, but thinking that now was as good a time as any to try it, I installed 2.0.3 and grabbed the first Nano that I could find here.Seems to work fine for me if I do things like:Code:Serial.println(digitalRead(A3)); // and/or ...digitalWrite(LED_BUILTIN,digitalRead(A3));

author: CDN_Torsten
author_rank: Regular Contributor
timestamp: January 23, 2023, 01:00:00 am
content: Quote from: Lindley on January 22, 2023, 05:00:41 pmI tested this and it too does not function correctly.

author: CDN_Torsten
author_rank: Regular Contributor
timestamp: January 23, 2023, 01:06:34 am
content: Quote from: ozcar on January 22, 2023, 08:06:10 pmI was somewhat reckless and updated my system.When you ran the code did you actually have a level applied to the pin which read back correctly, or did you just test if the compiler accepted it?My plan is to start with a new Sketch tomorrow which will only contain code to read A3 - I need to isolate the problem to ensure it's not something conflicting in the code.

author: CDN_Torsten
author_rank: Regular Contributor
timestamp: January 23, 2023, 02:00:41 am
content: Looks like a false alarm.... just created a new Sketch to only read A3. Seems like it is behaving correctly.I now need to see who's library is causing conflict in the main code.Grrr...really hate wallowing through other people's codeShould there be any interesting learnings I'll post it here.Thanks everyone!

author: CDN_Torsten
author_rank: Regular Contributor
timestamp: January 23, 2023, 04:02:46 am
content: The 'offending' code was located in the ST7920 driver - CS was being set as an output on A3 and driven low. I've removed this and everything is now working as needed.Sorry for the false alarm.

author: Lindley
author_rank: Regular Contributor
timestamp: January 23, 2023, 09:50:11 am
content: Did take a quick look at Arduino 2 but soon removed it as not that much different from the original and a bit suspicious of any bugs like yours.Plenty of far better IDEs out there to choose from , we use the Free Atmel Studio 7 ( now Microchip Studio) along with the Visual Micro plug in which enables you to work on new and existing Arduino IDE sketches etc. makes handling large code so much easier.https://www.learnrobotics.org/blog/arduino-ide-alternatives/

author: CDN_Torsten
author_rank: Regular Contributor
timestamp: January 23, 2023, 12:56:28 pm
content: Thanks for the suggestion(s).I was not aware that Atmel/Microchip Studio 7 could be used for Arduino Sketches.I've only used it to develop customer/critical code in C and ASM...will look into this.

author: bidrohini
author_rank: Regular Contributor
timestamp: January 24, 2023, 12:14:44 pm
content: Thanks for the post and the entire thread. Will avoid this version.

author: thm_w
author_rank: Super Contributor
timestamp: January 25, 2023, 12:55:30 am
content: Quote from: Lindley on January 23, 2023, 09:50:11 amIt wasn't a bug..and I would use Visual Studio with eitherVisual Micro, orVisualGDB. I wouldn't bother with the microchip edition, unless you needed it for other reasons. Might be harmless though.Quote from: bidrohini on January 24, 2023, 12:14:44 pmYou didn't read the thread though..