Jump to content

Photo

TI 99/4A interfacing


173 replies to this topic

#1 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Wed Apr 22, 2015 10:24 AM

Hi.

Since I'm constantly working on some wacky interfacing project or other, I figured I'll start a thread on the subject since I have a question.

 

I have been working on connecting the TI's parallel port to a Raspberry Pi equipped with the Pi camera to capture a picture on the TI. Since the Rpi is a 3.3V system, I have had to figure out how to achieve bidirectional logic level shifting between 3.3 and 5 volts. I found this 74LVC245 8-bit logic level shifter on Adafruit and I created a primitive communication protocol between the TI and the Rpi to control it. It worked quite well, and I am able to send data and control signals bidirectionally, but the thorny problem I am currently encountering is spurious signals generated somewhere triggering unwanted events and messing up the synchronization of the data transfers.

 

Each byte of the image captured by the Rpi is transmitted to the TI upon receipt of a HANDSHAKEOUT high signal from it to port 23 on the Rpi, and the cycle subsequently repeats until all the bytes are sent. What is happening is that there are spurious HSKOUT high signals somehow being generated, wreaking havock with the process. As a test, I set up the TI side to hold HSKOUT low after receiving the first byte, and yet the Rpi kept trying to send new bytes in for a few cycles before stopping and waiting. It's almost reminiscent of key bounce, except that there are no physical keys or switches involved here.

 

I have connected all the unused inputs of the 245 to ground or Vcc without any noticeable improvement, and I am currently at a loss as to how to eliminate that problem. 

 

If anyone here has any suggestions, I would be very grateful to hear them. I am running out of hair to pull!



#2 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 10,176 posts
  • TI-99/4A Fanatic
  • Location:In the den playing with my FinalGROM 99!

Posted Wed Apr 22, 2015 10:47 AM

I'm curious, are you using a flat ribbon cable?  Is it RF insulated?  Might it be running in parallel to other cables?  A flat lead RF choke or a couple of twists in the cable MAY make a difference.  Give it a shot before any more complicated actions... if you have not already done so.  You have nothing to lose.



#3 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Wed Apr 22, 2015 11:25 AM

I am in fact using the standard TI ribbon printer cable for this project, and it is fairly long. I did look up ribbon cable ferrite cores and ordered one. We'll see if that solves the issue.

Thanks for the suggestion!



#4 marc.hull OFFLINE  

marc.hull

    Stargunner

  • 1,113 posts
  • Location:Oklahoma CIty.

Posted Wed Apr 22, 2015 2:31 PM

Try pulling you buss high and let the ic sink the zeros.

#5 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Wed Apr 22, 2015 2:55 PM

Try pulling you buss high and let the ic sink the zeros.

 

Marc, could you please elaborate on that? I'm a self-taught amateur when it comes to electronics and I'm not sure how to do what you suggested...



#6 marc.hull OFFLINE  

marc.hull

    Stargunner

  • 1,113 posts
  • Location:Oklahoma CIty.

Posted Wed Apr 22, 2015 3:18 PM

 

Marc, could you please elaborate on that? I'm a self-taught amateur when it comes to electronics and I'm not sure how to do what you suggested...

 

I think we are all amateurs if truth be known ;-).

 

If whatever you are using as your clock signal to the Rasberry ever goes hi Z or is otherwise undefined at some point then the logic gate on the 245 will output an unknown.

 

If you put a resistor between the 245 output and 3.3v then that will ensure the output is always high or driven low only when it's supposed to be low.  This assumes an active low signal.  If active high the connect your resistor to gnd.

 

Of course this is conjecture, the problem may lie else where.

 

.



#7 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Wed Apr 22, 2015 3:38 PM

Ah! Well it's certainly worth a try. I'll test it out tonight. Thanks :)



#8 Stuart OFFLINE  

Stuart

    Dragonstomper

  • 666 posts
  • Location:Southampton, UK

Posted Wed Apr 22, 2015 5:23 PM

HSKOUT is generated by the TI using 5V logic, and needs to go to the RPi using 3.3V logic? Try doing the voltage conversion for this signal using a simple resistor potential divider rather than an IC. [http://www.savagecir...86&d=1372033234] Also try putting a 22 Ohm resistor in series at the TI end (after the potential divider) to minimise ringing on the line if it's a long cable.

 

May make absolutely no difference but simple to try.  ;-)



#9 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Wed Apr 22, 2015 5:52 PM

The Rpi also sends data and signals to the TI, so the outgoing voltages need to be upconverted from 3.3 to 5V. The IC is bidirectional and can be placed in high Z when not needed. Using voltage dividers for 8 data lines and 4 control lines will make for a rat's nest of components, not to mention the problem of isolating outgoing and incoming signals from each other.

My circuit is a little more complicated than I described, with separate bi-directional level shifter ICs for control and data lines, thus allowing me to send or receive data while sending or receiving control signals simultaneously. It seemed much simpler to use dedicated ICs for this process. 

Is there a way to add some kind of circuit to the end of the ribbon cable to filter out noise?



#10 marc.hull OFFLINE  

marc.hull

    Stargunner

  • 1,113 posts
  • Location:Oklahoma CIty.

Posted Wed Apr 22, 2015 7:18 PM

I don't think you need to tie your address and data lines but if you are shifting your control wires through the 245's then they should be tied on both sides unless you can guarantee they will not float at unoportune times and with two async machines I doubt that is feasible.

Can you post a schematic or sketch?

#11 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,673 posts
  • Location:BUR

Posted Wed Apr 22, 2015 8:36 PM

Marc's theory on randomly floating is probably the easiest one to test (especially since it's one line you've isolated -- if you prove it on that line, then you can examine the others).

 

With a long cable like that interference is also possible - chokes may or may not help. If you have a scope you could probably check for that - scope the HSKOUT line and toggle the line physically next to it, see if you are getting anything. /Might/ even be able to do it with a meter, but it won't be as easy to tell how large the interference is.

 

The other possibility is reflections, especially with a long cable. While there's a science to figuring out the right value to dampen them, you can likely absorb them without killing the signal with a 100 ohm resistor on the line (as a quick way to test).



#12 Stuart OFFLINE  

Stuart

    Dragonstomper

  • 666 posts
  • Location:Southampton, UK

Posted Thu Apr 23, 2015 1:31 AM

HSKOUT is generated by the TI using 5V logic, and needs to go to the RPi using 3.3V logic? Try doing the voltage conversion for this signal using a simple resistor potential divider rather than an IC. [http://www.savagecir...86&d=1372033234] Also try putting a 22 Ohm resistor in series at the TI end (after the potential divider) to minimise ringing on the line if it's a long cable.

 

May make absolutely no difference but simple to try.  ;-)

I was meaning just try this on the HSKOUT line to see if it improved the "the RPi keeps on sending data" problem. If it made no difference then nothing lost. If it did improve things then it might point to a problem with the level shifting IC circuit and you could investigate further.



#13 marc.hull OFFLINE  

marc.hull

    Stargunner

  • 1,113 posts
  • Location:Oklahoma CIty.

Posted Thu Apr 23, 2015 6:51 AM

Perhaps I misunderstood so to clarify...

You are coming straight off the side port and not the parallel port?

#14 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Thu Apr 23, 2015 11:31 AM

Perhaps I misunderstood so to clarify...

You are coming straight off the side port and not the parallel port?

 

No, I'm using the parallel port.



#15 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Thu Apr 23, 2015 11:40 AM

Well, I tried all of the above suggestions except for the ferrite block which I ordered, all to no avail. An interesting observation was that sometimes just touching the metal case of the TI triggered a pulse!

 

Below is a picture of the project and a block diagram of sorts. It's a rat's nest I know, and I wouldn't be surprised if some of the interference is coming from the Voyager 1 probe  :grin: . Eventually, assuming I can get it to work reliably, all this will be converted to a PCB.

 

TI Vision
20150423 121827

 

Any other thoughts guys?



#16 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,225 posts
  • Location:Silver Run, Maryland

Posted Thu Apr 23, 2015 11:47 AM

Well, I tried all of the above suggestions except for the ferrite block which I ordered, all to no avail. An interesting observation was that sometimes just touching the metal case of the TI triggered a pulse!

 

Below is a picture of the project and a block diagram of sorts. It's a rat's nest I know, and I wouldn't be surprised if some of the interference is coming from the Voyager 1 probe  :grin: . Eventually, assuming I can get it to work reliably, all this will be converted to a PCB.

 

Any other thoughts guys?

 

That pulse from touching the case may indicate an improper ground.

 

...lee



#17 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 10,176 posts
  • TI-99/4A Fanatic
  • Location:In the den playing with my FinalGROM 99!

Posted Thu Apr 23, 2015 11:56 AM

Well, I tried all of the above suggestions except for the ferrite block which I ordered, all to no avail. An interesting observation was that sometimes just touching the metal case of the TI triggered a pulse!

 

Any other thoughts guys?

 

Touching the un-connected metal case of the TI caused a pulse?  Wow, there is so much unshielded square-wave activity going on in that rats maze I dunno where to start!  I would suggest checking for a ground loop in that mess, you may have a couple of different potentials going on there that manifest when you touch ground.



#18 marc.hull OFFLINE  

marc.hull

    Stargunner

  • 1,113 posts
  • Location:Oklahoma CIty.

Posted Thu Apr 23, 2015 12:07 PM

Do you have a shared ps ground?

#19 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Thu Apr 23, 2015 2:56 PM

Do you have a shared ps ground?

 

No. I am using the 5V from the parallel port to power the 125 chips and the 3.3V from the Rpi to power the 245 and the inverter chips, and they each have separate grounds being on different breadboards. Should I have a shared ground?



#20 marc.hull OFFLINE  

marc.hull

    Stargunner

  • 1,113 posts
  • Location:Oklahoma CIty.

Posted Thu Apr 23, 2015 3:18 PM

Yes. Try connecting a logic ground from the TI PIO and a logic ground from the pi.

#21 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Fri Apr 24, 2015 7:18 AM

Creating a common ground seems to have eliminated the occasional triggers when the TI case is touched. It unfortunately did not have an effect on the HSKOUT issue though.

Another observation I made was that I get a burst of spurious HSKOUT high signals right after the first byte is sent and received by the TI for maybe a second (probably even less), and then nothing, almost like an oscillating process that dampens out with time. I am able to trigger the Rpi at that point by manually connecting the HSKOUT line to Vcc, so I know the program on the Rpi side is working as intended. It seems to me that the problem mostly lies on the TI side of things. 

Over the next few days, I'm going to systematically step through the process with the circuit connected to my oscilloscope and logic analyzer, paying particular attention to the output end of the parallel cable. I'm going to ferret out this bug one way or another! I'm also going to start laying out a PCB for the circuit since eliminating the rat's nest of wires will likely be helpful. One question here: should I use pull-up or pull-down resistors on the unused inputs? Also, should the unused outputs also be clamped as well? I'll post a schematic when I have it completed.



#22 OLD CS1 OFFLINE  

OLD CS1

    River Patroller

  • 3,822 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Fri Apr 24, 2015 8:55 AM

Well, I hope you do not run into much resistance in your efforts.  I see you as a transformer of sorts and suspect you can rectify the problem and bridge it into something for which you might be inducted. I diode your phone to help you ferrite out the problem.  Alas, I lacked the capacitance to remember your number.



#23 marc.hull OFFLINE  

marc.hull

    Stargunner

  • 1,113 posts
  • Location:Oklahoma CIty.

Posted Fri Apr 24, 2015 9:05 AM

If you have ungrounded, unused inputs then that could be your current issue (no pun intended.)

Tie unused inputs to ground (don't need a resistor.)

Don't worry about unused outputs.

#24 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Fri Apr 24, 2015 3:13 PM

Well, I hope you do not run into much resistance in your efforts.  I see you as a transformer of sorts and suspect you can rectify the problem and bridge it into something for which you might be inducted. I diode your phone to help you ferrite out the problem.  Alas, I lacked the capacitance to remember your number.

 

Nicely put :)



#25 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Eagan, MN, USA

Posted Fri Apr 24, 2015 3:14 PM

If you have ungrounded, unused inputs then that could be your current issue (no pun intended.)

Tie unused inputs to ground (don't need a resistor.)

Don't worry about unused outputs.

 

Ok I'll do that. Thanks.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users