PC control of ARM controlled current sources

Post details of your projects here.
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

PC control of ARM controlled current sources

Post by YahooArchive »

It often comes up in this forum, how do you control the ARM from a PC.

While I've thrown out some suggestions and simple examples, there's nothing like
the real thing. Recently we built a burn-in fixture for a client that provides
36 variable current sources and takes readings of the voltage across the device
with the specified current running through it. This is for an aging test.

So we did this with one of our controllers piggybacked onto a large custom
designed PCB that had all the analog stuff. The ARM responds to command C 0-255
to set current in 256 steps, and A 0-39 to read one of the 40 the 12bit A/Ds.
We do have a PC on the other side, so we can do the normalization of values
there.

The source is below

In the file you'll see the standard SPI routine was modified, the ADC we used
uses the SPI clock to clock the ADC, and that had to run about 150 KHz. So we
inserted some delays into the stock SPI library. I keep reminding people these
are not cast in stone, and the source is there so you can modify it.

There are a couple #defines in there, one to echo commands back, useful during
debug

And a #define to add some scope loops so the interface from the ARM to the SPI
devices could be checked.
Attachments
PC2ARMcontrol.bas
(3.74 KiB) Downloaded 831 times



Post Reply