20X2 to read 10 bit data and send to PC for plotting

ferrymanr

Member
I have an old spectrum analyzer which outputs X and Y voltages for external display or analogue plotting together with a pen up/down signal (not GPIB data). I have in mind using a 20X2 to perform two channels of 10 bit A/D and converting to HPGL plotting commands to send out as serial data to the PC which runs plotter emulation software. On starting a plot the 20X2 would send a string of HPGL set up data to set scale, origin, graph border and text etc. then perform the A/D conversions and send as a string of 'GOTO' X, Y commands to perform the plot. My previous projects show that I can handle serial data transmission to the PC reliably at a speed of 9k6 using HSEROUT which is adequate for this application. Dual channel A/D and noise reduction (averaging) may be a problem with a rapidly varying input voltage and the speed of the data transmission ( probably around 4 to 10 seconds for 1024 data pairs).

This is very like a 2 channel data logger interface so the A/D conversion to serial data is probably reinventing the wheel. Can anyone point me to a good thread on handling the dual channel A/D and etc.

Thanks
Richard
 

westaust55

Moderator
have a look at the excellent dual channel oscilloscope by forum member womai as a first suggestion.
http://www.picaxeforum.co.uk/showthread.php?9644


Suspect no one has posted here with exactly what you are looking for.
I think you will need to break your project down into sub-blocks and then indicate which blocks you need help with.
Links to specs on the data transfer you intend to implement may help someone.

At the moment the idea is in your head and we may be guessing at exactly what you wish to achieve.
 
Last edited:

BeanieBots

Moderator
What you are proposing sounds perfectly doable and reasonable.
As stated by Westy, break it down into sections which can be individually addressed with specific questions.

One concern would be speed. You will need to read both channels, convert to the appropriate code and send over serial in a time-frame that won't miss any significant changes in either channel.
The maximum rate at which you can do that will be largely dependent on your serial baud rate. To this end, to avoid the A/D noise issues and change rates that you have already expressed concern over, I would suggest that you feed the signals into a low-pass (R/C) filter before the PICAXE A/D. There is no point sampling at a rate higher than you can process. Also bear in mind that for 10-bit you will need to be working with word variables and to send 10-bit "goto" commands you will need to send TWO bytes for each value.

Remember that unless you are using an external reference (not sure if that is possible on the 20X2) that your reference is the PICAXE supply rail. For 10-bit to be meaningful, your supply must be rock solid and properly decoupled from any digital noise.
 

ferrymanr

Member
Thanks for advice. I will construct a breadboard version with input attenuators and some filtering then I will have a basis to test some simple software and find my (or Picaxe) limitations! My last project also used the 10bit A/D and complex linearising algorithms but did give me some experience.
Thanks
Richard
 
Top