Shop OBEX P1 Docs P2 Docs Learn Events
PWM and Parallel LCD compatibility — Parallax Forums

PWM and Parallel LCD compatibility

AndyhAndyh Posts: 13
edited 2006-03-29 17:00 in BASIC Stamp
I have a list of questions and am unsure whether to break them up into separate threads because they are all related:

Dropout issue:
An instrument I designed with a BS2p·has a parallel 2x16 LCD that is updated about every 10-15 seconds.· I was asked to add a 4-20 mA output and accomplished that with a PWM output into·an RC and op amps.· My output signal periodically drops, and I have·read in the Manual·that commands LCDCMD and LCDOUT cause "All I/O pins ... set to output mode."· This is apparently the cause of my problem.· I have temporarily addressed this with an active filter built on the op amps, but·the dropout is still noticeable at some signal levels.· Does anyone have a solution to this incompatibility?

I am looking at·eliminating the dropout by replacing the parallel display with a serial display, at more than double the cost ($30 vs ~$12), as well as the necessary re-programming.··I·still have a stock of·parallel displays to use up.· If I have to go serial - does anyone have the link to the circuit to convert a parallel to a serial LCD?· I2C to parallel LCD interface?· It's probably in Nuts&Volts archive somewhere.· 74HC595?· PCF8574?· MCP23016?· I have yet to try to operate through these ICs.· I'd hate to pay (I think) $30 for a Backpack from SEETRON, and figure out·mounting, too.

Optoisolator issue:
My original design for the 4-20 mA circuit included an optocoupler to pass the PWM to the RC (for galvanic isolation between the BS2p ground and the 4-20 output), but it didn't work.· I suspect a·4N37 isn't fast enough.···A 6N137 worked up to a point but I was out of time and finished the circuit with the grounds connected.· But I still have hopes for achieving isolation.· Does anyone have a working circuit for PWM through an opto-isolator?

DAC issue:
Another approach to solving the problem is to pass serial data through·an isolator into a DAC.· The BS2p has I2C commands and it shouldn't be too hard to get the 4-20 from a DAC output.· But I have spent far too much time searching for an I2C DAC in a DIP package.· The problem is the DIP pkg.· I have no access to surface mount capabilities.·· Can someone identify an I2C DAC in a DIP pkg for me?· 8-, 10- or 12-bit?

I could try the AD7303 (Serial, SPI, QSPI, Microwire, but not I2C) or LTC1661 (3-wire serial, not I2C), if someone has some code I can copy that will talk to these devices.· I understand I2C isn't too different but I'm analog and the thought of writing original code to accurately clock data into addressed devices is intimidating.

I'm almost out of I/O pins so I need to go to serial outputs anyway. ·I have a RC-4 and SSR's on order. ·I'll be adding two more DAC/digital pot·outputs·after I have·serial I/O working.

PS:· I know you'll want a schematic but I'm hesitant to attach·it since the 4-20·was not in my original patent application.

Thanks for any assistance and suggestions,

- Andy -

·

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-03-28 18:42
    seetron has a "serial backpack" to run your parallel LCD via -- http://www.seetron.com/bpk000_1.htm·(not exactly inexpensive.)

    Depending how good you are at prototyping, you might just go with the IC available there.

    Search around, someone might have PIC-an-LCDs available (www.bgmicro.com ?)
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-28 18:52
    Ok here's what I can help with:

    The likely problem you are having with the opto-coupler/isolator is that a great many of them are designed for transmission of digital signals, so matched linearity is not a critical parameter, something that is an absolute nessesity for analog systems such as 4-20mA control loops. So you would need an optoisolator specially designed for analog applications such as the HCNR200 or HCNR201. These expect an analog voltage input, so you may want to add an integrating capacitor to your PWM if you find straight PWM does not produce your expected linearity.

    The only I2C compatible DACs I can find readily in 8-DIP packaging are the MAX517 and MAX518.

    So your plan is to file a CIP with your updated design? Smart move not posting a schem since disclosure in continuations can get tricky. Mind sharing the original application number if you haven't filed a request for non-disclosure? (Im a patent examiner in class 711, that is why I know this stuff).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 3/28/2006 7:02:16 PM GMT
  • AndyhAndyh Posts: 13
    edited 2006-03-28 22:52
    Yes, I found when I explored the world of optocouplers that there were high-speed analog-rated ones, specifically for video, and bought a variety: 6N137 (aka HCPL-2601, is 10MBit/s with a logic gate output), HCNR200, HPCL-4562, and IL-610-2. But I ran out of time to try them and delivered what I could at the time. Now I want to go back and make it work right.

    What do you mean an integrating capacitor? That's the function of the RC on the secondary side of the opto. Where would I put a cap on the input side, the BS2p pin. In series? or to ground? I don't understand.

    Are you aware of the crazy random-noise PWM that the BS2p provides? See the Manual p.345 for description. I have a picture of the 'scope but can't figure how to attach a picture to the reply.

    If I stick with PWM I might generate it without using the PWM command. That would save the low-cost parallel LCD. In my magazine clipping file I have an (untested) circuit for a serial-input DAC controlling the period of a constant frequency square wave. Do it in hardware.

    I DO need to get up the learning curve on serial I/O.

    Thanks for the MAX517 rfeference.

    Patent application was predominantly on the process and internal algorithm and not the circuit itself. To tell the truth I don't have the number. There are four of us on the patent and the patent lawyer is in NY and I think only he and my boss have the final papers. I signed something that probably had the number on it but i don't have a copy here.

    I wish I had someone to review the circuit and tell me if it has any uniqueness that is patentable. We'd need a non-disclosure agreement, of course.


    - Andy -
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-28 23:22
    The integrating capacitor Im talking about is like the one in figure 5.27 here: http://www.parallax.com/dl/docs/prod/stamps/BasicStampMan2_0.pdf#page=250
    You may find you dont need it because there will be some averaging performed by the characteristics of the optocoupler, but the faster the response of the optocoupler the "choppier" the output signal will be. The capacitor will smooth the voltage to a more analog signal. This will also help reduce some of the switching noise since you will be forcing the pin on the stamp to not change so rapidly (and the optocoupler too).

    I can't help you with evaluating patentability of an application, it is an ethics violation for me to do so outside of my official duty. Pretty much the only thing I am permitted is "general art" searches and I cannot charge any fees for doing so. That said there are external outfits that will do such searches (for a fee of course), but the kicker is that anything they turn up must be submitted in a PTO-1449 (Information Disclosure Statement), since 37 CFR sections 1.97 and 1.98 legally require an applicant to submit all known related art and references for an application (IOW you get a search done, and you are required to inform the office of all references found that are relevant to the patentability of the application). But for the diligent applicant it is often in thier best interest of having it done, its much cheaper to pay someone to do a search, than pay an IP layer to prosecute the case and have an examiner reject it; or even worse, the examiner miss the reference, get the patent then have to pay legal fees to go to court to ultimately have your patent stripped away from you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • AndyhAndyh Posts: 13
    edited 2006-03-29 14:28
    well, yes, I'm using that RC to average the pulses into· dc to generate an output signal, on the output side of the opto.·

    I figured how to attach a picture.· You can't with the quick reply.· You have to use the "Post Reply" button.

    Here's a picture of what Basic Stamp calls "PWM" at about 50%.

    -Andy -
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-03-29 14:59
    · Right, Yep -- PWMOUT results "PWM"; it isn't constant-frequency, variable pulse-width [noparse][[/noparse]I'd love that, too.]
    · PBASIC Help goes on all about it.


    Post Edited (PJ Allen) : 3/29/2006 3:03:39 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-29 17:00
    Andyh said...
    well, yes, I'm using that RC to average the pulses into· dc to generate an output signal, on the output side of the opto.·

    I figured how to attach a picture.· You can't with the quick reply.· You have to use the "Post Reply" button.

    Here's a picture of what Basic Stamp calls "PWM" at about 50%.

    -Andy -

    You should try using one of the analog optocouplers, and placing the RC circuit between the stamp and optocoupler. I dont have any quantifiable data to prove it, but I think you will see much better characteristics in the current loop. For one I am fairly certain that most of the switching noise associated with the current loop will disappear. If you place some bypass caps across the supply for all the digital elements (such as the stamp), you should improve this even further.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
Sign In or Register to comment.