Hello all,
I thought I post this here (rather than in the "Finished Projects" section) since it is still work in progress:
I am currently porting my Picaxe based oscilloscope from the 28X1 (running at 16 MHz) over to the 28X2 (running at 40 MHz). On that occasion I already implemented a number of firmware improvements.
The most visible change is the much faster data acquisition rate, I now get over 11 frames/sec with a single channel, so the waveform display is very fluid ("real-time"), almost like a "big iron" scope. That's an overall acquisition rate (capture, transfer, display) of almost 3000 samples per second! Great job, little Picaxe! Of course you only get that fast an update rate if the sample rate (time base) is high enough - otherwise it takes more time simply to capture a full 256-point record.
In addition I changed the sample strobe generation for slow sample rates - before I had to change the clock frequency for that, which caused lots of headaches (because the serial baud rate changes as well), now I simply use a tight, hand-calibrated loop that generates the strobes using pulsout.
I also put a few minor improvements in the PC software (e.g. Up/Down controls for most settings, so no need to use the comboboxes), and reduced the data volume sent over the serial port (by going to variable-length command, which is easy with backgound hardware serial receive).
Some things I found during that effort:
Wolfgang
I thought I post this here (rather than in the "Finished Projects" section) since it is still work in progress:
I am currently porting my Picaxe based oscilloscope from the 28X1 (running at 16 MHz) over to the 28X2 (running at 40 MHz). On that occasion I already implemented a number of firmware improvements.
The most visible change is the much faster data acquisition rate, I now get over 11 frames/sec with a single channel, so the waveform display is very fluid ("real-time"), almost like a "big iron" scope. That's an overall acquisition rate (capture, transfer, display) of almost 3000 samples per second! Great job, little Picaxe! Of course you only get that fast an update rate if the sample rate (time base) is high enough - otherwise it takes more time simply to capture a full 256-point record.
In addition I changed the sample strobe generation for slow sample rates - before I had to change the clock frequency for that, which caused lots of headaches (because the serial baud rate changes as well), now I simply use a tight, hand-calibrated loop that generates the strobes using pulsout.
I also put a few minor improvements in the PC software (e.g. Up/Down controls for most settings, so no need to use the comboboxes), and reduced the data volume sent over the serial port (by going to variable-length command, which is easy with backgound hardware serial receive).
Some things I found during that effort:
- Most of the software port was painless, thanks to the conversion wizard in the program editor - nice idea!
- Some baud rate constants for hardware serial are undefined (e.g. 57600_40).
- I love the new pin numbering (A.0, A.1 and so on)!
- I just discovered that the X2 Picaxes can invert not only the hardware serial output, but also the input. Great - this means I was able to do away with the MAX232 interface and just use two resistors instead (180 Ohm in series with the TX pin, 22 kOhm in series with the RX pin). Very pleased with that - cheaper and simpler, thus more elgant!
- I found that the MAX232 was inducing significant noise into the scope signals. I saw about +/-2 LSBs worst case (meaning the signal spreads over 5 LSBs or almost 1/4 division on the screen). Wasn't a showstopper - many cheap commercial scopes are worse than that - but now the MAX232 is gone the signals are pretty much perfect - noise is down to 1 LSB pk-pk, which is the theoretical performance limit for an ADC. By the way, the Rev-Ed version of the scope doesn't have that problem because it does not use the MAX232 (I only needed that for background serial receive and to be able to go to data rates higher than
- At the same clock frequency, the execution speed of the 28X2 is a bit slower than the 28X1; that came as a bit of a surprise, if anything I had expected the 18F series PIC to perform faster than the 16F series (which is indeed my experience when I program both in compiled C). Maybe because of the X2's extended command set? A rough check indicated around 25% slower. On the other hand I can run it at 40 MHz (10 MHz resonator and 4x PLL), so it's still about twice as fast as a 28X1 running at 16 MHz, or 50% faster than a 28X1 running at 20 MHz.
- The 28X2 seems a bit marginal on the download connection; both devices that I own frequently yield checksum errors during download - has anybody else seen that? Somewhere between every other time to once in around 10 downloads; I couldn't yet make out a pattern. The 28X1's (dozens of them) never have any issue at the same computer in the same setup. Has anybody else had the same experience?
Wolfgang