Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help Open Collector Rs232 Uart microcontroller

Status
Not open for further replies.

mitchjs

New Member
Hey all,

Great forum...

I have a Mp3 player that has a 5v rs232 control port

It comes with 1 controller, i want to make my own
i got the protocol, and i wrote code for a atmel AVR
that part all works, i want to interface it to the mp3 player

the company told me, no problem, just wire the output of the
uart in the AVR Open Collector to the mp3 players TX wire

ok, i think i understand it... but can some one show me the
drawing of the transistors

I know i need two transisors, 1 will invert the uarts TX, then the second one will invert it back and provide open collector output

also HIGH is the idle state of the line, so do i need to pull it high?

in that case thats not exactly open collector is it?

i need a Wired "or" solution

thanks!

mitch
 
mitchjs said:
I know i need two transisors, 1 will invert the uarts TX, then the second one will invert it back and provide open collector output
The hardware uart in a avr sends the signal inverted, because it is intended to be used with a level converter chip like a max232 (wich inverts the signals). So there's a good chanse you only need 1 transistor.

mitchjs said:
also HIGH is the idle state of the line, so do i need to pull it high?
If the company told you to wire it 'open collector' then i would expect it to have a internal pullup...

Anyway, for the open collector setup
get a NPN transistor (bc546 or similar), connect it's base to the uart output trough a base resistor (10K should work), connect it's emmiter to ground and the collector is your open collector output
 
good point, i never noticed that on the max232

does that mean most microcontrollers output tx inverted?

ok, then i guess any general purpose npn will do

mitch
 
mitchjs said:
does that mean most microcontrollers output tx inverted?
Yes...When using the hardware usart...

If you program a software usart then you can use wichever polarity you want
 
help uart to uart wiring

i need to refrase...


Im never going though a max...

i have to connect the AVR TX line to 2 different microcontrollers

on one of them, i see a vague schematic, where the TX line comes out of their micro and goes to a 1k ohm resistor then to the controll connector

when i connect it to a max232, data comes in nicely in the pc, all bytes correct
so i conclude its std uart output 5v=0, 0v =1, sound right?

i guess thats what the atmel wants too

the other one seems easy too...

i connected tx to rx, and send some bytes, the device responded

each device uses a different baud, but i only need to talk to one at a time

i guess i could use some kind of mux
but i figued, when im not talking to one, the other just gets garbage, and no harm done


so how should i wire it, and keep the uarts protected....

mitch
 
The device works with 5V signals? so does your atmel? and they both invert the data?

just connect them straight togheter...
 
I still don't really understand what you are trying to do?. From what I can gather you're wanting to feed two seperate 5V 'RS232' devices from one processor? - just use a seperate processor output pin to each, and use sofware UART's.
 
i dont want to use sw uart unless i have to
this avr is also processing SPI data
and will be constantly processing uart rx
and sending spi out

mitch
 
Status
Not open for further replies.

Latest threads

Back
Top