Switchable Inverted Comm


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2008
    Location
    Michigan, USA
    Posts
    231

    Default Switchable Inverted Comm

    Hi all,

    Anyone try and use the Comm inverting feature that is on chips like an 18F2540?
    The register is BAUDCON and bit RXDTP sets RX polarity. I don't know how many chips it is available on, but I have found a few.

    I would like to be able to make a selectable "invert" on non-RXDTP chips, but so far, I haven't come up with an elegant way. Trying a couple of transistors in a totem pole, but not exactly working yet.

    Just fishing for ideas.

    Mark

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Mark, Dude! I've never seen those before.

    WOW! The possibilities ....

    A quick FIND command in DOS reveals the following chips have it.

    18F2221, 18F2321, 18F2410, 18F2420, 18F2423, 18F2450, 18F2455, 18F2458, 18F24J11, 18F24J50, 18F2510, 18F2515, 18F2520, 18F2523, 18F2525, 18F2550, 18F2553, 18F25J11, 18F25J50, 18F2610, 18F2620, 18F26J11, 18F26J50, 18F4221, 18F4321, 18F4410, 18F4420, 18F4423, 18F4450, 18F4455, 18F4458, 18F44J11, 18F44J50, 18F4510, 18F4515, 18F4520, 18F4523, 18F4525, 18F4550, 18F4553, 18F45J11, 18F45J50, 18F4610, 18F4620, 18F46J11, 18F46J50, 18F65J50, 18F66J11, 18F66J16, 18F66J50, 18F66J55, 18F66J60, 18F66J65, 18F67J11, 18F67J50, 18F67J60, 18F85J50, 18F86J11, 18F86J16, 18F86J50, 18F86J55, 18F86J60, 18F86J65, 18F87J11, 18F87J50, 18F87J60, 18F96J60, 18F96J65, 18F97J60

    I didn't cross-reference with PBP compatability.

    Now then ....

    What to do with them ???
    DT

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    OK, this is just too wrong!

    Somtimes you're told things that stick as Hard-Facts, and you never look for the alternative.

    Like, ...
    If you're using the USART, it has to be TRUE levels
    You have Shattered my World!

    Thanks,
    DT

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    I've never used this for sending inverted data with the USART, but it's really handy for
    using the TX pin as an output on a 16F690.

    With the USART setup to receive data, you can flip BAUDCTL.4 to set or clear the
    hardware USART TX pin. Without it, you're stuck with the TX pin at logic 1 whenever the
    USART is enabled.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Feb 2008
    Location
    Michigan, USA
    Posts
    231

    Default

    Hi guys,

    Stumbled across it while trying to figure out how do I use the USART. I was afraid that I couldn't do what I was trying to do with a smaller chip, so I was shopping up the line. Just caught my eye. I did mention it once briefly on another post, but no one picked up on it, so I figured it must not be a big deal to anyone else..

    The reason for the need is related to a project that has been driving me to spend inordinate amounts of time on this forum and in front of my computer typing cryptic things that make casual observers believe that I know what the hell I'm doing.

    I had asked some questions about model train DCC communication systems where they alternate the polarity of DC voltage to the tracks at different frequencies to communicate to on-board decoder/driver boards. I found a number of good DIY programs, but they were assembly and very hard for me to pull apart and modify for my purposes. I have spent the past few months learning mimic the parts of the system that I needed for my uses.

    Essentially, I need to talk to a number of modules over only two wires that also carry the 12 VDC power.

    The need for the inversion function is that I can't guarantee the installed polarity of other parts on the system, and in order to make it more robust, it takes power through a bridge rectifier and taps the comm sensing off of the power lines before the bridge through limiting resistors. The first part of the code looks for the idle levels on the line and sets the RX accordingly.

    The project currently resides on a 16F628A and is working fairly well. I am looking at running the input through a XOR gate as a selectable inverter to control weather to invert the incoming signal or not.
    http://www.fairchildsemi.com/ds/NC/NC7S86.pdf

    mark

  6. #6
    Join Date
    Aug 2004
    Posts
    64

    Default inverting USART ?

    Hi:
    The 18F25J11 is not included in PBP. May be in the P250d.exe upgrade.?
    Greetings...
    Ruben de la Pena V.

  7. #7

    Default

    Maybe you could do this using some form of Dallas 1-wire communication. Use optoisolators to change the voltage levels. The 1-wire communication protocol is already set up for parasitic power management.
    Tim Barr

  8. #8
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Quote Originally Posted by boroko View Post
    Anyone try and use the Comm inverting feature that is on chips like an 18F2540?
    The register is BAUDCON and bit RXDTP sets RX polarity.
    Thanks boroko for informing us about it. I finally got a chance to try setting RXDTP and TXCKP and try a bootloader without MAX232 on a PIC18F2520, and it worked!

    Thanks again.

    Walter

  9. #9
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818

    Default

    Quote Originally Posted by Bruce View Post
    I've never used this for sending inverted data with the USART, but it's really handy for
    using the TX pin as an output on a 16F690.

    With the USART setup to receive data, you can flip BAUDCTL.4 to set or clear the
    hardware USART TX pin. Without it, you're stuck with the TX pin at logic 1 whenever the
    USART is enabled.
    I gotta try this out, would have saved me ripping up a PC board design if I had read this earlier, thanks Bruce ! And thanks to Mark for the heads up too !
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. SERIN to HSERIN and Inverted Logic
    By Stubbie in forum Serial
    Replies: 5
    Last Post: - 22nd June 2008, 04:09
  2. Pic to pic interrupt ans serial comm
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th May 2008, 22:43
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. Comm example: Pic to Pic
    By Chadhammer in forum Code Examples
    Replies: 4
    Last Post: - 14th November 2006, 23:26
  5. 16F877, DS18S20 and Serial Comm Problem
    By YellowTang in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th April 2004, 10:36

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts