Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 5th August 2004, 05:43 PM   (permalink)
Default Help Open Collector Rs232 Uart microcontroller

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 is offline  
Old 5th August 2004, 07:20 PM   (permalink)
Default Re: Help Open Collector Rs232 Uart microcontroller

Quote:
Originally Posted by mitchjs
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.

Quote:
Originally Posted by mitchjs
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
Exo is offline  
Old 5th August 2004, 07:31 PM   (permalink)
Default

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 is offline  
Old 5th August 2004, 07:34 PM   (permalink)
Default

Quote:
Originally Posted by mitchjs
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
Exo is offline  
Old 7th August 2004, 07:36 AM   (permalink)
Default 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
mitchjs is offline  
Old 7th August 2004, 09:26 AM   (permalink)
Default

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

just connect them straight togheter...
Exo is offline  
Old 7th August 2004, 11:54 AM   (permalink)
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 7th August 2004, 02:36 PM   (permalink)
Default

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
mitchjs is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 12:30 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker