JPigg55,
I'm pretty sure Arduino can handle these scales, but the implementation will need to be very "slim" (highly optimized). I've spent a lot of time optimizing the code for MSP430, which has a leg-up on ATmega328 with 16 bit architecture. There are a few gotchas: data stream speed is much faster at 250 HZ refresh rate (which can be tempered by pulling the "Req" line high when the controller is not ready), 2 KHz clock speed, the need to deal with 64 bit integers, and the format conversion (BCD to 32 bit integers) that requires 6 multiplications per reading (not a trivial task for Arduino).
I can give Brian a few pointers as to how I did that for MSP430, and hopefully he will be able to figure out the rest. Let me know if I van help you with the hardware too.
Regards
Yuriy
Yuriy, didn't know you were on this forum.
I know Brian has been in contact with you already. I know he's been working on making the Absolute scales work with the Launchpad format in parallel with the Arduino, May be done, but I'll pass on the message and you two can compare notes.
He emailed me today and said he thought he'd have a working mock-up by this evening for the Arduino. He has only the one scale that I lent him and was concerned about being able to sync all the clock speeds for mutiple scales with the clock speed residing on the scales themselves via an oscillator instead of the display providing it.
From his email yesterday:
"I was looking thru the code for the interrupt library I found, and I do think it'll work. I'm working on programming the on board timer now, I want to read a bit every .5ms once it gets triggered. A 2kHz frequency means that the read head will send a new bit every .5 msec (or .0005 sec).
Here's How it's Going to Work:
A change in state from the read head data line means the read head has started sending data. This will fire off a pin interrupt.
The pin interrupt routine will:
A) Disable the pin interrupt - read head is sending data now, stop waiting for it
B) Fire up the timer to generate a timer interrupt every .5 ms
The timer interrupt will:
A) Read the state of the pin. This is the data bit.
B) Bit shift into a variable. Steps A) and B) will be one line of code.
C) Increment a counter. The counter will run up to 36. This is all the bits the read head sends. Not all 52 bits are being used, and the first 4 that get sent only denote units, so they will be discarded.
After the counter hits 36, the timer is shut down and the pin interrupt is re-enabled. The data will then be sent to the app, the data variable reset to zero, and the cycle is complete.
With the 328P running at 16MHz, it will update every .625usec (or .0000000625 sec). This means the Arduino has time to execute 8000 instructions in the time it takes for the read head to send 1 data bit. We should have plenty of time to spare, and plenty of time for 4 axis and a tach.
All in all, everything should be plenty fast enough. The code is going to be compact, but it will have to be repeated for each axis.
Once I learn a little more about programming the timers I'll get to work writing a sketch to read one axis.
Since I found that interrupt library, I'm convinced the Uno will work just fine, otherwise I think we might have had to go to a Mega or Due.
Thank Goodness for an active Arduino community!!!!! "