Shop OBEX P1 Docs P2 Docs Learn Events
Problem interfacing with external devices — Parallax Forums

Problem interfacing with external devices

Paul BakerPaul Baker Posts: 6,351
edited 2005-01-18 15:23 in General Discussion
I have a board which was pulled from surplus medical equipment. On it is 3 HDLG-2416s (http://www.yocous.go.ro/stor/hdlg2416.pdf) with the /CE tied low and a 74HCT138 which drives the write signal to each. I have it displaying the simple 'Hello World' message, I have solved the timing issue caused by the 74' part (It would operate when I stepped, but not when it ran). But I found that when using the oscillator, sometimes when I would plug in the power connector, the message would not display, even if the reset button is pressed (but sometimes it would work when plugged in). I thought that I wasn't giving the board enough time to settle before pumping it information, so this morning I put a delay loop in my program after initialization of the SX ports but before I sent it data. Now it never runs with the oscillator plugged in. I tried putting a cap between the Vdd and Vss of the board to make the supply rise more slowly (in case its getting latched into a freak state from the power on surge) still no help. I removed the delay loop, still cant get it to ever work with the oscillator.·But when I am in debug mode of the SX-Key and I press Run (or walk through)·it always works perfectly, but if I press run from the main window it doesn't (which makes me think its not the oscillator). And now Ive run out of ideas to fix it.·Has anyone encountered a similar problem interfacing with an external part?

Paul

Comments

  • PJMontyPJMonty Posts: 983
    edited 2005-01-16 19:30
    Paul,

    You said, "But when I am in debug mode of the SX-Key and I press Run (or walk through) it always works perfectly, but if I press run from the main window it doesn't (which makes me think its not the oscillator)" If anything, it should make you think the exact opposite. When you're debugging, the SX-Key is providing the clock. When you program the SX chip for independent operation (via Run->Program or CTRL-P) and then pull the SX-Key and hook up your oscillator, then your clock is the only clock source.

    If it's not working when the SX-Key is gone and your oscillator is hooked up, you have to start with the assumption that something is wrong with your oscillator (since it's the only one present) and then start working on to different possible solutions if the oscillator checks out okay.

    Things that can help folks help you diagnose these types of problems are:
    • What type of oscillator you are using. Is it a pre-built TTL oscillator? A resonator? An R/C circuit?
    • What your DEVICE line looks like. Telling the SX the wrong type of osciallator on the DEVICE line can cause it to not work properly.
      Thanks, PeterM
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-16 19:47
    My program header is:

    DEVICE SX28AC, OPTIONX, TURBO, OSCHS
    IRC_CAL IRC_FAST
    FREQ 50_000_000
    RESET Main


    I am using the 50Mhz resonator supplied with the SX-Tech board, the reason I dont think its the resonator is that when I hit run from SX-Key Main window (Ctrl-R) the same thing happens as with the·resonator (it doesn't work), but when I press run just after entering the debug window, everything works fine. I don't know enough about how the SX-Key does things·to understand how running the program using the different methods (program, debug mode, run vs program, run) is different.

    Paul

    Post Edited (Paul Baker) : 1/16/2005 7:50:37 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-16 23:52
    Ok this is driving me nuts, I've inserted a 2^32 delay after every signal transition. Sometimes when I plug it in (with resonator) it works, sometimes it displays gibberish and after about 8 times writing the phrase it writes the correct thing, sometimes it never writes the correct thing. I cant figure out where this error is coming from, the SX or the display.

    Paul

    I have included the code in its present state. When I press the reset button whether it works or not is a Smile shoot, I'd say about 10-20% of the time its correct, the rest its not. GDI I need a DScope.

    Post Edited (Paul Baker) : 1/17/2005 12:28:20 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-17 00:50
    Ok I think I've narrowed it to some sort of power up issue with the board. But I still cant always get it to work, for some reason, the board doesn't intialize properly. I wish I knew exactly what was going on with this thing. If it works properly the first time it always works every time I press reset, If it doesn't work the first time pressing reset doesn't work. The most frustrating thing is whenever I change the code, its behavior changes (one code, pressing reset sometimes works, do a code update and pressing reset 50 times doesnt work)

    Paul

    Oh yeah, another thing its behaviour changes with time. I went and ate, came back plugged it in and out maybe 10 times before it worked, sat here typing for maybe 5-10min with the thing on, now everytime I unplug and replugged it in it worked. The specs say nothing about needing warm up time that I remember.

    Post Edited (Paul Baker) : 1/17/2005 1:06:53 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-17 03:21
    Ah geez I feel like a complete moron now, after yanking the cable, all the jumpers and configuring the prototype area with my external sram and all jumpers I discovered when copying initialization code for the memory test program that I set the pull ups to $ff, in other words disabled without any external pullup resistors. Now I wonder how the thing worked at all. Well after I finish the testing of the memory I'll try again.

    Paul, smacks his forehead and leaves a red mark.
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-17 04:07
    It's really good to know that even the experienced periodically get whacked by the 2x4 of oversight. smile.gif

    Cheers,
    Jim
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-17 15:09
    It just goes to show you the old addage is true, "You should never assume...". Because I had a timing issue early on with the 74' part which skewed the timing diagram for the operation of the HDLGs, I assumed that when I was running full speed and having difficulties with it behaving properly that it was still a timing issue. What still puzzles me is that the 74' part was a HCT variety, meaning it had TTL levels. It is clear now that the lines were floating, but its strange that they were capable of floating upto Vih, and fairly constistantly for periods of time. Probably when the SX output was in High-Z, the gate capacitance of the HDLGs and 74' discharged back into the line, causing the voltage to elevate (though I wouldn't have expected the voltage to rise to Vih). This also explains why sometimes when I would move the cable, the display output would change, I thought it was due to a bad connection, turns out I was altering the capacitance of the cable, changing its capability to hold the charge injected into it.

    Paul won't make the same mistake again.

    Post Edited (Paul Baker) : 1/17/2005 5:08:59 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-17 16:50
    Man I'm just batting a 1000 here, Im stepping through my memtest program in SX-Key (after SXSim-ing the prog to verify its proper operation) and I get to a point where I notice two address pins on port C stuck (one at 1, the other at 0), check the solder joints on the SOJ to DIP board: OK, double check all jumpers: OK, step through program 3 times: still stuck. Unplug memory from breadboard, step through program: not stuck. Look at specification sheet part number: CY7C109B/CY7C1009B, Look at actual chip part number: CY7C1019B, look up spec sheet for CY7C1019B: completely different pinout. Look at specs for CY7C109B: 128x8K, 12ns, 32-SOJ, async SRAM; Look at specs for CYC1019B: 128x8K, 12ns, 32-SOJ, async SRAM. What the heck kind of company puts out two chips, identical specs, varies the part number by one then makes totally different pinouts! (The two pins that were stuck:Vdd and GND, the chip was trying to draw its power through the onboard 20k pullup resistors)

    Paul, will be unconscious soon if he continues to get whacked by the 2x4 of oversight.shakehead.gif

    I think there should be an emoticon for whacking yourself for being dumb.

    Post Edited (Paul Baker) : 1/17/2005 4:59:46 PM GMT
  • ForrestForrest Posts: 1,341
    edited 2005-01-17 18:19
    I'm pretty sure a 74HCT is for CMOS voltages, not TTL
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-17 19:42
    I was taught that HCT was CMOS operating at TTL levels (Highspeed CMOS, TTL Level), but a quick check of the spec sheet shows a Vih of 2V (attached pic) This is a CMOS Vih, I guess it is rather (Highspeed CMOS, TTL Compatible). This would better explain·why it would occasionally work since the Vih is less than half TTL's Vih.

    Paul
    740 x 172 - 35K
  • James NewtonJames Newton Posts: 329
    edited 2005-01-17 21:00
    Paul Baker said...

    Paul, will be unconscious soon if he continues to get whacked by the 2x4 of oversight.shakehead.gif

    I think there should be an emoticon for whacking yourself for being dumb.

    Welcome to my world buddy! Most engineers will have a list of things to check when something goes wrong, but top of my list is "what stupid thing did I do???"

    I've come to define progress as making the mistakes as fast as possible. I figure once I get past all of them, some actual work can get done.

    Just one complaint: PLEASE don't suggest another icon! Especially not one that moves... I can't tell you how distracting I find the little bastards as it is. The two that jump up and down are the worst. They pull my eye away from the message I'm typing at least several times each reply. I could live with it if not for those two.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james@sxlist.com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • pjvpjv Posts: 1,903
    edited 2005-01-17 21:38
    Hi James;

    You nailed it as far as these sillyand distracting little blurbs are. I wish they could all be trashed. Don't folks have any real work to do??

    Peter
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-17 21:50
    Peter said...
    Don't folks have any real work to do??


    freaked.giffreaked.gif Don't you recognized a l33t h4x0r when you see one? roll.gifjumpin.gifjumpin.gifhop.gifburger.gif

    This is my work dude!

    Very big tongue in cheek grin!


    Jim
  • ForrestForrest Posts: 1,341
    edited 2005-01-18 01:13
    OK, now I'm the one that's confused. Sorry for temporarily hijacking this thread but I recently bought a 74HCT164 serial shift register to interface an SX28 or a BS2 with a paralled (Hitachi HD44780 compatabile) LCD. I bought this part by mistake - what I really wanted was a 74HC164 - which works fine acording to a schematic I found on the web. For this application, is the HCT part a drop-in replacement for the HC part?

    Secondly, is there a good online resource discussing the all the variations of the 74 series IC's and the significance of using an LS vs. HC vs. HCT parts.
  • pjvpjv Posts: 1,903
    edited 2005-01-18 02:05
    Well, there's the proof again; small things amuse small minds.....

    Peter
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-18 03:18
    *withdraws his suggestion for a new emoticon*

    Forest: I'll look around for a resource when I'm bored tomorrow (its bound to happen). Off the top of my head there is alot more hysteresis in an LS part (Low Power Schmitt Input) than CMOS parts. And there are alot more variations (ALS, AHLS, ALVS,...), if I need to, I compile a list and thier characteristics. Since this is off topic I'll start a new thread in the sandbox forum. Perhaps some stampers can use the info as well.

    Paul

    btw mem is working fine, display still has some quirky behavior, but if I intialize it by writing spaces to the display repeatedly before writing real data I works predictably.

    Post Edited (Paul Baker) : 1/18/2005 3:21:26 AM GMT
  • Don WadeDon Wade Posts: 1
    edited 2005-01-18 03:35
    1) LS stands for low-power Schottky (not Schmitt) refering to the type of transistors the device is made of. There may be Schmitt-trigger inputs depending on the specs of the particular device but that has nothing to do with the LS designation.

    2) 74 HC and HCT devices should usually be pin compatible as far as the functions of the pins go. Whether they are drop in replacements depends on the characteristics of the circuits they are being used with and the power supply used.

    Don Wade
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-01-18 15:23
    Sorry I was going to write Schottky last night, but I was a little tipsy (a rare thing) I tried to find the spelling of Schottky but I was so off on my spelling that I couldn't get an answer, I then looked up a part and it would only state the inputs were Schmitt, so I incorrectly wrote that in. I will refrain from writing posts in the future when I've had any alcohol in my system (not going to be an issue, was at a friends BDay party and they wouldn't leave me alone about not drinking, so I caved)

    Paul
Sign In or Register to comment.