Shop OBEX P1 Docs P2 Docs Learn Events
Coupling a Prop to a PIC — Parallax Forums

Coupling a Prop to a PIC

MicksterMickster Posts: 2,694
edited 2012-12-30 08:17 in Propeller 1
Well, I have read enough stuff about 3.3v to 5v level shifting but I am still unsure of the best method to couple the Prop directly to one or more (5v) PIC18F2331 chips. I need the Prop to be the master and to have the PICs tied to the same Rx Tx lines. Each PIC will adressable and only speak when spoken to. What would be the ideal connection method for this when all chips are located on the same PCB?

Many thanks,

Mickster

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-12-29 10:53
    Well, if you are NOT going to use any i/o as bi-directional, the simplest is likely the best.

    Tx at 5 volts requires a resistor - 3.3K ohms seems quite adequate to protect the Propeller. People have argued anywhere from 2.2K ohms to 3.9K and beyond. The 3.3K is easy to buy and quite conservative. Parallax has been known to use 3.9K in their own products.

    Rx at 5 volts requires no protection as the 3.3 volt high will not damage anything.
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-12-29 12:19
    I'd suggest to have a resistor on each PIC TX-PIN - at least during development-time. This prevents damage on PIC-side caused by programming errors! (If PIC 1 pushes TX to high and PIC 2 pulls it to low this gives you a nice shortcut if you don't have the resistors in place or with only one resistor on Propellers RX)
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-29 12:25
    Hi Loopy;
    Rx at 5 volts requires no protection as the 3.3 volt high will not damage anything.
    Well, not quite.
    Vin high at 3.3V, with the 3.3KΩ series resistor, only works if the selected pins are configured for TTL buffer mode.

    Duane J
  • kwinnkwinn Posts: 8,697
    edited 2012-12-29 13:17
    Mickster wrote: »
    Well, I have read enough stuff about 3.3v to 5v level shifting but I am still unsure of the best method to couple the Prop directly to one or more (5v) PIC18F2331 chips. I need the Prop to be the master and to have the PICs tied to the same Rx Tx lines. Each PIC will adressable and only speak when spoken to. What would be the ideal connection method for this when all chips are located on the same PCB?

    Many thanks,

    Mickster

    This worked for one PIC in a project of mine. Should work for multiple PICs although you may need to replace the 3.3K resistor with a level translator with multiple PICs. A '245 bus transceiver can also be used between the PICs and the 3.3K resistor in place of the level translator if you happen to have one handy.
  • kwinnkwinn Posts: 8,697
    edited 2012-12-29 13:19
    Oops, forgot the diagram.
    690 x 315 - 8K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-12-29 13:46
    So, when a "Prop" is coupled to a PIC, is the result a ...?
  • kwinnkwinn Posts: 8,697
    edited 2012-12-29 13:50
    LOL. Good one.
  • MicksterMickster Posts: 2,694
    edited 2012-12-30 06:16
    Cost not being an issue....should I just go RS485 and be done with it?

    Thanks again.

    Mickster
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-30 06:26
    No, a simple 3.3KΩ resister is much easier and safe.

    Duane J
  • MicksterMickster Posts: 2,694
    edited 2012-12-30 07:32
    Sounds good....Thanks all!

    Okay, now a different question...The PIC requires a 10Mhz clock...would you install a separate crystal or set-up a Prop counter to produce this on an output pin and if so, would the 3.3v level be okay?

    Cheers!

    Mickster
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-30 08:17
    Hi Mickster;
    Mickster wrote: »
    Okay, now a different question...The PIC requires a 10Mhz clock...would you install a separate crystal or set-up a Prop counter to produce this on an output pin and if so, would the 3.3v level be okay?
    DC coupled 3.3V is not technically within the PIC's spec. Yes it may work but it would be better if the clock to the PIC was clearly within the spec not just on the edge.
    But AC coupling would be:
    ClockPropToPic.png

    And the counters NCO output would do just fine. Maybe send 40MHz to the PICs

    Duane J
    239 x 187 - 7K
Sign In or Register to comment.