Couldn't use Mode pin (IO4) on Panda as PWM

I tried to use the IO0 pin or Mode pin on Panda, by hook up the Piezo
to it (positive to IO4 and negative to GND)

I use the sample code and the driver from the Piezo Hardware.

When I connected the usb power, the Visual studio did not recognize the hardware. (as shown)

But when I dissconnected the GND wire. I was able to build the app with no error.
And if I connected the GND wire back, I also able to run the app. and the Piezo works.

Can someone tell me why it happened like that?

:smiley: You are changing the debugging interface to serial instead of USB

From USBizi user manual

[quote]“On power up, this pin is used to select the communication interface for GHI boot loader
and debugging, between USB (High) or COM1(Low). (refer to GHI boot loader section)
This pin is high (select USB) if not connected.”[/quote]

Whatever you connect to this pin, you have to make sure it is in the state you want on power up (USB vs UART). Connecting a load such as a peizo will make it low on power up. so maybe connect the peizo from that pin to 3.3V instead of ground

That’s working great! ;D

Thanks Gus and Josef.