|Bitbanging Over SuperPro Board Too Slow
|Page 1 of 1|
|Author:||HylianSavior [ Thu Feb 14, 2013 9:37 am ]|
|Post subject:||Bitbanging Over SuperPro Board Too Slow|
I am trying to use the SuperPro board to interface with the following sensor: http://www.parallax.com/StoreSearchResu ... fault.aspx , a breakout board for a part whose datasheet can be found here: http://pdf1.alldatasheet.com/datasheet- ... asheet.pdf .
I wrote up some very basic code to bitbang the reading of the sensor by toggling pins through Xander's third party RobotC library (code is attached at the bottom). This successfully reads from the sensor, but is too slow. The sensor is an op-amp integrator attached to a phototransistor, and the capacitors that hold the values for each integrator max out by the time the data is pulled.
What would be the best way to reduce overhead on the sensor reading?
One solution may be to use the square wave function of the DAC to toggle the CLK pin of the sensor much more quickly, but I don't think there is a way to check how many clocks have passed, which is necessary for knowing the state of the shift register.
Another solution may be to write SuperPro C code to read the sensor and and communicate the data to the NXT. This way, all the lower level reading would be done on the SuperPro MCU and there would be less overhead. However, it seems SuperPro C only works with NXC, and even then, I can't seem to find any documentation on it at all. Would such a method be reasonable and be compatible with RobotC?
I could also connect another microcontroller to the SuperPro board that interfaces with the sensor and communicates it to the board. This seems a bit convoluted, as I would have to send bidirectional serial data over the digital pins of the SuperPro board. I am also worried about power considerations with this method, as when I previously tried to attach a ATmega328P to the SuperPro, it browned-out due to insufficient current.
RobotC Code Attached:
|Author:||mightor [ Fri Feb 15, 2013 11:52 am ]|
|Post subject:||Re: Bitbanging Over SuperPro Board Too Slow|
There is no way to shorten it through this way, so your next best bet would be to use the SuperPro C. There is a guide here: http://bricxcc.sourceforge.net/nbc/spcdoc/SPC_Guide.pdf
You can program it through BrixCC. I've only ever used it very briefly but it is quite nice.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group