Very noisy SERTXD

benryves

Senior Member
I have a PICAXE 28X1 connected to a TI graphical calculator (via portC).

The calculator's link protocol uses two data lines that normally float high, and either device can pull the line low to start a bit transfer. Which bit is transmitted depends on which line is pulled low: the sender pulls one line low, waits for the receiver to pull the other low, releases the original line then waits for the receiver to release theirs; repeat eight times per byte. By using portC I can directly connect the calculator to the PICAXE without any additional circuitry (switching pins between inputs and ouptuts). Both data lines are pulled high with 47K resistors.

When I use SERTXD, though, the calculator sees both data lines toggling high and low very quickly. I assume this is due to electrical noise, as if I unplug the serial cable from my PC the calculator sees both lines remaining at a steady high level (as they should).

Any serial communications back to the PC cause this behaviour (such as the DEBUG command); the calculator sees spurious data being sent. Again, unplugging the serial cable resolves these problems.

I'm using the standard two-resistor circuit for connecting the PICAXE to the PC's serial port. Power comes from either a cheap 9V PSU or PP3 (via a 1A 5V regulator); the effects are the same on batteries or from the PSU.

Can anyone suggest any measures I could possibly take?
 

BeanieBots

Moderator
This sounds like more than a simple noise issue.
Any chance of getting a 'scope on those lines?
Interesting that it is only with PC connected.
How is the display powerd? Maybe ground loop with PC earth.

Do you know the voltages for each logic level on the display?
It maybe that a little more interfacing is required to do some level shifting.
47k is a little high. Have you tried with 4k7?

Double check connections to PC. In particular, current limit resistor on incomming serial line. This may be putting excess current onto the power line.
I'm sure a 'scope really would find your problem quite quickly and then a solution would be just as quick to follow.
 

benryves

Senior Member
Any chance of getting a 'scope on those lines?
Not on my budget, I'm afraid. :(

How is the display powerd? Maybe ground loop with PC earth.

Do you know the voltages for each logic level on the display?
It maybe that a little more interfacing is required to do some level shifting.
47k is a little high. Have you tried with 4k7?
If this refers to the calculator, then it has its own power supply (four AAA batteries). The common connection from the data port is connected to 0V on the PICAXE circuit and then its two data lines are directly connected to the PICAXE pins.

If I connect a multimeter to the calculator's data port between common and one of the data lines it varies between 5V (low) and 0V (high).

I get the same result with 4K7 (or even 1K) resistors. I don't want to put too much strain on the data port.

Double check connections to PC. In particular, current limit resistor on incomming serial line. This may be putting excess current onto the power line.
I'm sure a 'scope really would find your problem quite quickly and then a solution would be just as quick to follow.
The resistors are the same values as documented in the PICAXE manual.

I tried this on a different PC (with integrated serial ports) and it doesn't do this; the serial ports on my PC are on a PCI card.

Thanks for the help. :)
 

benryves

Senior Member
Here is a link to the schematic for "offical" serial interface for the TI calculator:
The TI calculator doesn't have a serial interface, but the cable linked to can be used to hook it up to a PC's serial port with the protocol handled in software (the timing of the signal doesn't matter, as each bit is acknowledged; the TI calculators don't have reliable clocks, being based on a simple RC circuit).
 

BeanieBots

Moderator
Does the calculator get upset if you send a sertxd line without the PC connected?
That is, is it the connection to the PC, the sertxd, or both that is the problem?
 

benryves

Senior Member
Does the calculator get upset if you send a sertxd line without the PC connected?
That is, is it the connection to the PC, the sertxd, or both that is the problem?
If I unplug the programming cable between my circuit and the PC, yet still call SERTXD, I don't get this problem.

Code:
Do
    Debug B0
Loop
If I run the above program with the PICAXE connected to the PC, the data lines connected to the calculator rapidly flicker high and low. If I unplug the PICAXE from the PC (with the program running) the data lines stabilise.

If I leave the PICAXE connected to the PC but don't issue use any serial communications functions the data lines remain stable.

I'll check over all the connections again tonight and see that there aren't any components crossing eachother or solder between tracks. The intended circuit matches what's in the manual. :)
 

BeanieBots

Moderator
This is looking like a wiring fault but hard to think what it could be that's wrong yet still functions.
I assume the PC sees correct data with debug?
I assume you have good decoupling for the PICAXE?
Any electrical data about the calculator. It would be useful to know what the actual threshold voltages are. ie what voltage is required for logic high. How low is required for logic low. I've met some devices that require as low as 0.3v to be logic low and only 0.7v for logic high.
 

Mycroft2152

Senior Member
I managed to find my old TI-83 calculator. If you haven't solved the problem yet, post the code for the PICAXE and calculator, either here on the public forum or as a private message (new function) and I'll try to duplicate your results.

Myc.
 

benryves

Senior Member
This is looking like a wiring fault but hard to think what it could be that's wrong yet still functions.
I assume the PC sees correct data with debug?
Sorry, you're quite right; it is a wiring fault.

I usually think of the innermost ring on a jack plug as the common connection (the one closest the cable) as it is on most audio equipment (and the TI data port).

On my strip-board I'd seen a wire coming from that point on the jack socket I'm using, and I also saw that it went somewhere near the PICAXE's 0V connection at the bottom, so thought that it would make a handy point to add a connection to the TI data port's common connection.

In short, I went and connected the calculator's data port to the serial out pin instead of 0V.

As for the intermittent fault: I'm using switched jack sockets, so thanks to a bad solder joint when the cable is removed the PICAXE's serial out pin is shorted to 0V. I'm not sure why it appeared to work when I tried it on a different PC, but I was probably doing something daft (like testing with the non-debugging version).

Thanks for all your help and suggestions, though!
 

Mycroft2152

Senior Member
You are not alone, the pin assignments on the stereo plug has bitten us all at one time or another.

Isn't standardization wonderful!
 
Top