PSoC black magic

So, today the programming team took a braek from actually programming in order to design our control board. This included an in-depth test of the Cypress PSoC device, which exhibited some strage behavior.

The default configured analog inputs on the PSoC, when not connected to anything, seemed to be showing us data like an accelerometer would if mounted with its axis perpendicular to the board. In other words, the voltage that the Classmate reads varies depending on the number of Gs the board is experiencing.

When a jumper is placed along the analog input, it stops showing accelerometer data and jumps up. However, any analog input with a higher number than it also shows the same value. In other words, any analog inputs with a higher number behave as if they were reading from the same input.

The PSoC does this both when it is in “compatible” mode and “advanced” mode. Does anyone know what’s going on, or how to fix it? I’m hoping we don’t have to have it replaced/exorcised.

Unconnected Analog Inputs don’t have a defined behavior, and should be ignored - there is nothing that defines the voltage, so you get really weird symptoms. This is not considered to be an error; putting a pull up/down resistor would have clearned up readings that don’t matter but negatively affect readings that actually do matter.

What you are seeing is called “charge injection”. Any muxed analog to digital converter will squirt a tiny bit of charge into or out of each channel proportional to the difference in voltage between that channel and the one before it. Since the accelerometer is the only thing active on the mux, ghosts of its signal will propogate down the chain.

Like Eric said, don’t read any channel you didn’t wire up. Better yet, ground every analog you haven’t wired so that you won’t chase ghosts while debugging.

Greg McKaskle