A Fast Data Aquisition System
Paul Baker
Posts: 6,351
I am contemplating creating an extremely fast data acquisition system, I have a 128KB asynchronous SRAM with a 12ns access time. Using·only an·SX, I've figured the quickest code to pump the SRAM full of information (for 64KB of the SRAM)·is:
·
:loop··setb ra.0
······ clrb·ra.0
······ inc rb
·······snz
······· inc rc
······ jmp :loop
·
Where ra.0 is the write strobe to the SRAM, and rb and rc are the address. Termination of the loop is accomplished via the RTCC overflow via the RTCC pin by a user signal.·Each iteration of the·loop is 8 cycles which results in a 5.55 MHz rate of acquisition. By using a couple external counters (74F256 if I remember correctly) and driving the counter by the write signal (some delay via·an inverter to provide the SRAM with enough address hold time would also be necessary), I can reduce the loop to:
·
:loop· setb ra.0
······ clrb ra.0
·······jmp :loop
·
Each loop iteration is 5 cycles producing an acquisition rate of 10MHz. Fast, but I want even faster. The jump is now the limiting factor, but I can't unroll the loop without introducing a lack of symmetry into the acquisition. So I have come up with the following solution: the ra.0 pin is attached to a serial delay line with 5 taps having a start to finish delay of 100ns (available from Dallas·Semiconductor), feed the 5 taps + ra.0·to a 8->4 priority encoder, feed the encoded value to a parity generator chip, feed the output of the parity generator chip to the external counter and SRAM. To show you how this works the loop code must be be changed to:
·
:loop· clrb ra.0
······ setb rb.0
······ nop
······ jmp :loop
·
The clear and set of the strobe are reversed, since the priority encoder is an active low signal.·A mapping of the data is:
·
Cycle 1,······ Cycle 2,····· Cycle 3,····· Cycle 4,····· Cycle 5,····· Cycle 6
0············· 1············ 1············ 1············ 1············ 1
1············· 0············ 1·············1············ 1············ 1
1 -> $0 -> 0·· 1 -> $1 -> 1· 0 -> $2 -> 0· 1 -> $3 -> 1··1 -> $4 -> 0· 1 -> $5 -> 1
1············· 1············ 1·············0············ 1············ 1
1············· 1············ 1············ 1············ 0············ 1
1············· 1············ 1·············1············ 1············ 0
·
The nop is inserted to align the system so there is an alternation of bits between each cycle, the first column is the ra.0 bit followed by the output of each of the delay outputs, the 2nd number (the hex value) is the output of the priority encoder and the final result is the odd parity output of the parity generator (the even parity output would work too). This method would yield a 25MHz data acquisition system since clocking signals would be produced even when a jump is occurring within the SX.·My question is: is there a simpler/more elegant solution? could I perhaps connect a clock buffer circuit (with an enable pin) to the resonator of the SX or would that effect the ability of the resonator driving of the SX (maybe use the resonator to drive a fan out (of 2 or more) clock buffer to drive the SX off one output and the SRAM system off another?·
·
Paul
·
:loop··setb ra.0
······ clrb·ra.0
······ inc rb
·······snz
······· inc rc
······ jmp :loop
·
Where ra.0 is the write strobe to the SRAM, and rb and rc are the address. Termination of the loop is accomplished via the RTCC overflow via the RTCC pin by a user signal.·Each iteration of the·loop is 8 cycles which results in a 5.55 MHz rate of acquisition. By using a couple external counters (74F256 if I remember correctly) and driving the counter by the write signal (some delay via·an inverter to provide the SRAM with enough address hold time would also be necessary), I can reduce the loop to:
·
:loop· setb ra.0
······ clrb ra.0
·······jmp :loop
·
Each loop iteration is 5 cycles producing an acquisition rate of 10MHz. Fast, but I want even faster. The jump is now the limiting factor, but I can't unroll the loop without introducing a lack of symmetry into the acquisition. So I have come up with the following solution: the ra.0 pin is attached to a serial delay line with 5 taps having a start to finish delay of 100ns (available from Dallas·Semiconductor), feed the 5 taps + ra.0·to a 8->4 priority encoder, feed the encoded value to a parity generator chip, feed the output of the parity generator chip to the external counter and SRAM. To show you how this works the loop code must be be changed to:
·
:loop· clrb ra.0
······ setb rb.0
······ nop
······ jmp :loop
·
The clear and set of the strobe are reversed, since the priority encoder is an active low signal.·A mapping of the data is:
·
Cycle 1,······ Cycle 2,····· Cycle 3,····· Cycle 4,····· Cycle 5,····· Cycle 6
0············· 1············ 1············ 1············ 1············ 1
1············· 0············ 1·············1············ 1············ 1
1 -> $0 -> 0·· 1 -> $1 -> 1· 0 -> $2 -> 0· 1 -> $3 -> 1··1 -> $4 -> 0· 1 -> $5 -> 1
1············· 1············ 1·············0············ 1············ 1
1············· 1············ 1············ 1············ 0············ 1
1············· 1············ 1·············1············ 1············ 0
·
The nop is inserted to align the system so there is an alternation of bits between each cycle, the first column is the ra.0 bit followed by the output of each of the delay outputs, the 2nd number (the hex value) is the output of the priority encoder and the final result is the odd parity output of the parity generator (the even parity output would work too). This method would yield a 25MHz data acquisition system since clocking signals would be produced even when a jump is occurring within the SX.·My question is: is there a simpler/more elegant solution? could I perhaps connect a clock buffer circuit (with an enable pin) to the resonator of the SX or would that effect the ability of the resonator driving of the SX (maybe use the resonator to drive a fan out (of 2 or more) clock buffer to drive the SX off one output and the SRAM system off another?·
·
Paul
Comments
Just something to watch out for. I don't think you can toggle a bit in consecutive instructions because of how the instructions are executed in the pipeline. Or maybe that only applies to reading the pin ???
Bean.
Post Edited (Paul Baker) : 11/16/2004 9:41:57 PM GMT
Get a 75 MHz oscillator.· Run the SX off of it, and add a 74F00 into your idea.· Tie one of the NAND inputs to the oscillator, the other to a pin on the SX.· Tie the output to the enable lines on the counters, and feed the 75MHz into the counters as well.· Feed the carry out of the high counter to an INT of the SX and also add it into the line to stop the clock when it goes hi
Then, you simply strobe the pin to start acq, and it will INT you when it is done.· 75MHz data acq as well.
Jim
As an aside, anyone have an idea for a programmable data acquisition rate? My guess is a divide by N counter.
Paul
Post Edited (Paul Baker) : 11/17/2004 3:27:31 PM GMT