Picaxe Oscilloscope & Picaxe 28X2

womai

Senior Member
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:

  • 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?
For anybody interested in the scope, you can easily upgrade the one Rev-Ed offers; a 28X2, a 10 MHz resonator, and the two resistors (180 Ohm & 22 kOhm) is all you need. I'll post a more detailed description once I am finished with all the software changes. All new PC software versions will need the new firmware and hardware.

Wolfgang
 

Andrew Cowan

Senior Member
Hi Wolfgang

I have the 'initial' scope, one of your first designs (V1.0).

Do you have any advice on upgrading that one to use the 28X2?

Thanks,

Andrew
 
Last edited:

hippy

Technical Support
Staff member
Some baud rate constants for hardware serial are undefined

The X2 compilers should have had a greater number of predefined baud rates added; I'll pass that information along.

At the same clock frequency, the execution speed of the 28X2 is a bit slower than the 28X1 ... A rough check indicated around 25% slower

The 28X2's do handle things differently and have to do more in the firmware so that could be the reason. The basic instruction time of the non-X2's is around 250us, 25% of that would be 62us, an extra 62 instructions per Basic command executed. I have to admit that I haven't looked at instruction timing on the X2's so cannot confirm or deny your finding.

By default the X2's run at 8MHz as against 4MHz so programs ported to the X2 with no SETFREQ should see an increase in speed of execution.

The 28X2 seems a bit marginal on the download connection; both devices that I own frequently yield checksum errors during download

In the process of developing, debugging and testing, there have been numerous downloads made into various X2's and I haven't noticed any such problems.

The Serial In is a Schmitt Trigger input ( as also on 18, 18A, 18M, 18X, 28, 28A, 28X, 40X ) which is more stringent on input voltage than TTL so that could be part of the issue. With that said, most of my hobby development has been with 18X and I've not encountered problems in that respect.

Are you using a USB-to-serial ( and which ) or physical RS232 port for downloading ?
 

womai

Senior Member
Andrew,

your scope is indeed one of the earliest versions, and as such does not use the MAX232 at all. There have been a few changes to the Picaxe's pin assignment from your version (V1.0) to the one on my website (V1.1) and the one Rev-Ed sells (V1.3) (and which I will put on the website soon). All of them can be upgraded.

To upgrade your scope, you'll need to add a 22kOhm resistor between the hardware serial pin (I/O7 / leg 18 on the Picaxe) and the RX pin on the download connector (or, alternatively and closer, the "hot" side of R2 ands the hardware serial pin). For TX no change is needed (i.e. no additional 180 Ohm resistor). In addition, you'll need the 28X2 and the 10 MHz resonator.

I can then adjust the pin assignment in the firmware to match your scope. You'll be the Guinea pig then because I no longer have a V1 scope to try it with :) (but the changes are very limited).

Hippy - I use a true RS-232 output on my PC, no USB-to-serial converter. I tried with both serial ports on this PC but the result was the same.

Wolfgang
 

Andrew Cowan

Senior Member
To upgrade your scope, you'll need to add a 22kOhm resistor between the hardware serial pin (I/O7 / leg 18 on the Picaxe) and the RX pin on the download connector (or, alternatively and closer, the "hot" side of R2 ands the hardware serial pin). For TX no change is needed (i.e. no additional 180 Ohm resistor). In addition, you'll need the 28X2 and the 10 MHz resonator.

Leg 18 seems to be attached to the 'top, one from left' pin of J_EXT connector. I see the 22K/10K download arrangement - do I just need to attach a wire from leg 18 to the PICAXE end of the 22K resistor?

I can then adjust the pin assignment in the firmware to match your scope. You'll be the Guinea pig then because I no longer have a V1 scope to try it with :)

Sounds good. Does anyone else have a V1.0 scope?

Andrew
 

womai

Senior Member
>Leg 18 seems to be attached to the 'top, one from left' pin of J_EXT
> connector. I see the 22K/10K download arrangement - do I just need to
> attach a wire from leg 18 to the PICAXE end of the 22K resistor?

Yes, jumpering the hardware RX to the serial download pin (leg 18 to leg 6) should work as well and is easier in your case. And it does connect to J_EXT as you found out.

There are close to 10 V1 scopes out in the world. Rev-Ed aka Technical has one so they could try as well.

I've attached the relevant page of the V1 schematic to this post.

Wolfgang
 

Attachments

BCJKiwi

Senior Member
@ Womai,

OK, Same Q for V1.1

This has the Max232A-CPE on board but the V1.1 diagram is the same as shown in your last post.

Presumably pulling the MAX232 and some other track/R tweaks should work.

Have had a quick look at the scope and circuit diagrams but can't quite figure it out.
 

lbenson

Senior Member
I also have a V1.0 scope and would like to do the upgrade. Oh, so little time and so many tech toys.
 

womai

Senior Member
BCJ,

yes, you need to pull out the MAX232. Then in the empty 16-pin DIP socket bridge pins 8 & 9 with the 22kOhm resistor, and bridge pins 7 and 10 with the 180 Ohm resistor (that way you don't have to mess up the board trying to remove the socket). Replace the 28X1 with the 28X2 and the 16 MHz resonator with a 10 MHz resonator. That's all what is needed hardware-wise.

I still need to finish up some cosmetic changes, also upgrade my V1.1 scope (so I am sure it works as intended - so far all work is done on a V1.3 version) take a few pictures showing the changes, and then I'll post the new PC software, Picaxe firmware, description and pictures on the scope website. I'll let everybody who bought a scope or a board know when this is online.

I'm really getting to like the 28X2's capabilities.

Wolfgang
 
Last edited:

dietmar

Member
Hallo! thanks to PhilHornby.at last it looks like i am going in the right direction -here is question for Womai:should i wait with trying to download the software for kit 120 osc. (don,t even know where to find it)or change the hardware to 28x2 plus and then get the proper software.
I was very surprised that somebody responded so fast ,I am very happy and hope i can do the same one day.
Stay safe
Regards Dietmar
 

stan74

Senior Member
Hi guys, what's 28x2 scope about please? I tried making a "scope" but no analogue hardware just take a-d samples
and display. Was this a project?
seems a long time since someone mentioned it.
 
Top