Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Inverting RS232 ttl level logic

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Unsupported versions
View previous topic :: View next topic  
Author Message
snow

Bascom Member



Joined: 28 Jun 2005
Posts: 200
Location: Ashburton / Mid Canterbury / New Zealand

newzealand.gif
PostPosted: Mon Jun 04, 2018 11:47 am    Post subject: Inverting RS232 ttl level logic Reply with quote

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
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Mon Jun 04, 2018 1:08 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2156

netherlands.gif
PostPosted: Mon Jun 04, 2018 3:03 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
snow

Bascom Member



Joined: 28 Jun 2005
Posts: 200
Location: Ashburton / Mid Canterbury / New Zealand

newzealand.gif
PostPosted: Tue Jun 05, 2018 11:24 am    Post subject: Reply with quote

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
View user's profile
six1

Bascom Expert



Joined: 27 Feb 2009
Posts: 553

germany.gif
PostPosted: Tue Jun 05, 2018 12:43 pm    Post subject: Reply with quote

did you read EVERT's hint on INVERTED
_________________
For technical reasons, the signature is on the back of this message.
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Unsupported versions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum