View previous topic :: View next topic |
Author |
Message |
snow
Joined: 28 Jun 2005 Posts: 200 Location: Ashburton / Mid Canterbury / New Zealand
|
Posted: Mon Jun 04, 2018 11:47 am Post subject: Inverting RS232 ttl level logic |
|
|
Howdy all.
How do you invert RS232 TTL level logic. I'm doing a bit of a hack on a PTZ camera . Im modifying it as i don't need the camera only the motorized base.
I have found the Data line between the Camera webserver and Pan Tilt control board. It uses Pelco D protocol by the looks of the data i've sniffed off it.
My problem is the voltages are TTL level and i cant use the serialout or print statement to drive it as it doesnt work.
How would i convert RS232 ttl to toggling a pin for a data stream ??
Cheers
Snow
(BASCOM-AVR version : 2.0.7.8 , Latest : 2.0.8.1 ) |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Mon Jun 04, 2018 1:08 pm Post subject: |
|
|
It is not clear, for me, what you want to achieve.
Inverting signals means that signal from positive will became negative and vice versa. For this you can simply use some Hex inverter like 74HC00...but you probably want to level converter or level shifter.
If this camera use RS-485 line then you can use MAX485 for 5V Atmega or MAX3485 for 3V Xmega...and read about "Config Print". |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
Posted: Mon Jun 04, 2018 3:03 pm Post subject: |
|
|
The software uart supports inverted levels
Code: |
Open "COMD.1:9600,8,N,1,INVERTED" For Output As #1
Open "COMD.0:9600,8,N,1,INVERTED" For Input As #2
|
_________________ www.evertdekker.com Bascom code vault |
|
Back to top |
|
|
snow
Joined: 28 Jun 2005 Posts: 200 Location: Ashburton / Mid Canterbury / New Zealand
|
Posted: Tue Jun 05, 2018 11:24 am Post subject: |
|
|
Thanks.
I have broken into the data line between the camera and the motor pan/tilt control board . Eventually i want to control the pan tilt motors directly and throw the camera away. I just need the motorized platform for a project.
The camera sends data to the board as an TTL data as a pelco d protocol. If i cut the data wire and read it with tx/rx on my UNO and send it back out it doesn't work as the voltages are inverted. eg idle 5v where the cameras data is idle 0v. I was thinking at inverting the comms data voltages to see if that works. It just seems funny i can read the data but cant send it to the motor board to get it to work.
Ill give the inverted command a try or am i missing somthing??
Cheers
Snow |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Tue Jun 05, 2018 12:43 pm Post subject: |
|
|
did you read EVERT's hint on INVERTED _________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
|