I believe I damaged my Mega, however more concerning to me is that I don't know how it happened and I'm hoping that those of you more experienced may be able to speculate as to how.
Yesterday I used a few of the different frequency modules (
<FreqMeasure.h> and
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/arduino-pwm-frequency-library/Arduino%20PWM%20Frequency%20Library%20v_05.zip and
Gammon Forum : Electronics : Microprocessors : Timers and counters)
and I noticed that after I uploaded frequency code (I'm not sure which module this started with) that my A1 and A2 stopped working and now they output 2.8v as pinMode(A1, INPUT_PULLUP); and 1.8 as pinMode(A2, INPUT_PULLUP);, as well as 2.53v as pinMode(A1, OUTPUT); and 0.47v as pinMode(A2, OUTPUT); . I believe that test confirms that A1 and A2 are hosed, correct? Is there any sort of firmware reset I can try?
I'm confused as to what could have caused this, I did not knowingly change anything with those pins and the hardware has remained the same for at least a week. My Arduino was supposed to be well protected using the circuit below and A3, which is using a duplicate of A1 and A2 (and even resides on the same breadboard) is still functioning correctly? To be more descriptive I have 3 replications of the below circuit on the same breadboard, all using the same supply voltage source. The Arduino is powered by my laptop and there were no storms or anything recently. VCC is 4.72 and the output from the circuits to A1 and A2 are 4.7x, down to 0.3 when the momentary contact button is pressed.
Someone explained that with freqmeasure, you lose pwm functionality with pins 6, 7 and 8. I'm wondering if any of those modules could have affected the functionality of any of the analog in pins? I was also under the impression that with the circuit below, my Arduino pins were well protected?
[edit]
Could this have happened because I left that circuitry connected and uploaded a frequency test sketch that did not have those pins configured as inputs/anything at all?
// testing code
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A1, OUTPUT);
//pinMode(A1, INPUT_PULLUP);
pinMode(A2, OUTPUT);
//pinMode(A2, INPUT_PULLUP);
}
void loop()
{
// put your main code here, to run repeatedly:
Serial.println("Looping");
delay(3000);
}




