Got a new Due and it seems to have messed up everything... :(

I replaced my old Due because yesterday, when I was making a simple circuit with an LED and a microswitch, and whenever I pressed the microswitch, the board itself seemed to make a highpitched noise that came from the chip? So I got a new one.

Run into a heap of issues with the new board:

  1. Constantly getting error message that no device is connected to COM4, but pressing reset or erase on board seems to fix this issue. Never had this issue with old board.

  2. Or unsupported processor message...

  3. When I hit compile and upload, it uploads an old program and it wont stop. My program has lots of serial prints in it for debugging. So I deleted most of it (and thus most of the messages/variable readings) and when I re-upload and run the serial monitor again, I am still getting seeing those old messages (despite the commands for them being deleted). I have tried pressing erase on the board... but I guess its the IDE sending an old program and I cant figure how or why its doing it?
    ... Also when I pressed fix encoding and reload, it stuck my old program back in... why makes me think that the IDE has my old program stuck in its memory or something and isnt seeing all the changes I am making etc...

I am using windows 10 and the latest IDE

Any help will be greatly appreciated I am using arduino for a uni project which is worth a fair amount of marks!

high pitched whine would be (I suspect) because you miswired the switch and it was shorting out the power when pressed, resulting in a whine from the switching power supply on the Due board (unlike the AVR arduinii, the Due has a switching regulator to generate the 3.3v). If it was shorting through the chip, that probably damaged the chip - but I'd be surprised if that made a whine noise (as the pins can't source or sink that much current on the Due). I think it's more likely that you were accidentally shorting the supply rails themselves.

Switchers will frequently squeal like that when you push them.

I followed this, and I have assumed the orientation of the microswitch does not matter. But like you say, I am using a Due not an Uno so I could be shorting something?

I am not entirely sure how to fix this?

On a Due, you can't put 5v onto a pin. That diagram shows 5v connected to the switch, so 5v would by put onto the pin when the button is pressed. Is that how you wired it? Or did you use 3.3v?

Putting 5v onto a pin of the Due can damage it (and that could have explained the whine - current through the protection diodes).