Wednesday, 19 December 2012

DSO Revelations

So today while doing the thoroughly mentally stimulating task of watering trees at work all day I had an epiphany. I am building a Digital Storage Oscilloscope ie. I can have 2 programs that run and have them mutually exclusive. A capture program that reads the state of the ADC(s) and pushes them to a more stable memory location(seperate section of RAM, Main HDD[my be a section of flash memory on board] or Dedicated section of Flash memory). The pseudo-code for this would be along the lines of:
Reset counter
While Stop = False do
Move state_of_ADC to register0
Move register0 to Permanent_Location[counter]
counter = counter +1
EndWhile

This would give a sampling rate that can be calculated fairly easily. The instructions are fairly basic so they should each only take 1 cycle to execute. Therefore 5 cycles are required to monitor the state. Therefore we just divide the clockspeed of the CPU by 5 to give us the sampling frequency(assuming CPU at 1GHz):
1GHz/5=200MHz
That's a 200MHz sampling rate. The only problem with this method is that the only real way to change the sample rate is to change the CPU's clock speed... But if I'm going to build a radio from scratch then I dare say I'll get used to adjusting frequencies with a voltage...

The other program would be a GUI that allows the "settings" to be adjusted and a graph to be displayed. The "settings" would only effect the display. Unless I decide to implement software controllable attenuation or something useful like that. The attenuation would be done before the ADC and would be instructed to attenuate through the communication bus from the ADC which is activated for reverse transmission by sending a pin to say -5V which shouldn't happen in any other situation.

Anyway is anyone finds this helpful/instructive/wrong don't hesitate to leave a comment, more comments inspires me to write more :)

p.s. If anyone sees the HTML tags wrong or wants me to go through the tags I used here let me know any I'll put something up.