Loading...
Uncategorized

Snow Storms, ADS1247, .NETMF, and Friday Night

image

Snow day today which means I didn’t make it into work. Seriously though, I tried. Shovelling out at 8am when the snow was at it’s worse and not a plow in sight. Heard it was going to abate by 10am so figured I’d try again then. Everything I had shovelled looked filled in, waited until 12pm. It stopped, so shovelled again. Test run to Tim Horton’s made me realize it’s a death trap out there. Nothing that my Subaru Impreza with some Falken Eurowinter’s couldn’t handle, in fact I enjoyed it (once I turned OFF traction control). No, the problem is that people in Ontario tend not to buy winter tires, park on the street when they have a perfectly good driveway (filled with snow?), and generally do not know how to drive. In Newfoundland things would have likely remained opened and I would have gotten a coffee downtown with friends in that weather. In Ontario, 200+ accidents, not a plow in sight because they “wait” until it’s over. My street isn’t cleared and more poorly parked cars are now making it improbable to get down the road.

So what you are seeing above is the beginnings of talking to the ADS1247. Why am I using a Microsoft product, i.e: Visual Studio? The short answer is that I’m all out of Arduino Pro Micro’s (I’ve got some TI 430 Launchpad’s though, but never made it into playing with them much). I have a spare Arduino Leonardo and a FEZ Panda II. The Leonardo = 5v, the Panda = 3.3v. For some daft reason I’m assuming the ADS1247 doesn’t like 5v, but that might be a hold over from using the AP2. I am literally now checking the 60+ pages of datasheet printed off…. Well I am wrong, max of 5.5V… so I could have used my Leonardo. I will, but I’ll get it working on the FEZ Panda II first. I have to solder onto the SPI breakout for the Leonardo though which is very annoying.

DSC_9072

As inefficient as the .NETMF architecture is, the Visual Studio Environment is nice to develop in – I’m sure someone will shoot me for saying that. I digress though.

What you are seeing is resetting the ADS1247, Stopping the reading (shouldn’t have started?), and reading back 2 registers of the 16. Not bad. Now the work gets more interesting. Setting registers and scouring my apartment for a potentiometer.

The ADS124x series has a lot of I/O for an SPI device. In addition to the normal Slave I/O, SCLK, and CS, you also have a Reset line, a DRDY Data “Ready Line, a CLK line for the actual conversion and a START line. I know it’s a full featured ADC but the communications is about five times more complicated than my ADS8321. Raise CS, read three bytes, shift them all 2-3 bits, and you have a short output. This requires setting registers, likely confirming them, telling it to read the data, telling it to stop, writing registers to switch inputs, telling it to read, and so on. It all can happen quickly, a few commands, but it’s a little more boggling to deal with.

Seriously, why don’t I have a 100 potentiometers! ugh.

My soldering job seems to have gone off without a hitch. Again, Thanks to Josh over at Josh.to, his code for his espresso machine is a nice jumpstart.