Log in

View Full Version : Switchable Inverted Comm



boroko
- 3rd January 2009, 21:54
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

Darrel Taylor
- 4th January 2009, 05:07
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 ??? :)

Darrel Taylor
- 4th January 2009, 05:43
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,

Bruce
- 4th January 2009, 20:18
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.

boroko
- 5th January 2009, 00:02
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

Ruben Pena
- 15th April 2009, 20:47
Hi:
The 18F25J11 is not included in PBP. May be in the P250d.exe upgrade.?
Greetings...
Ruben de la Pena V.

falingtrea
- 16th April 2009, 19:19
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.

ScaleRobotics
- 31st December 2009, 18:43
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

Archangel
- 10th February 2010, 17:51
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 !