Open Collector transistor

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
           +5V
           |
           R 10k
-----------+---------------->
           |              To another station 
TxD       |/              and in the end into
---R 10k--|               an RXD of a maste AVR
          |\      
           |  
  BC548   \|/
           |
          GND

I'm making a bus. I wan't multiple devices to be able
to transmit (not all together). It will be similar to an I2C. I think this will work.
Will this work? Won't the Uce of the transistor be too big?

The "picture":
On each station a pullup resistor is connected to a central bus. When TXD = 1, the bus is pulled down. The tranzistor is connected to the ground with its emmiter.
Thank you,

David

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So long as TxD idles low, it OUGHT to. But, do not forget that this transistor adds an inversion so you also need an inversion at each receiver!

I would make sure that some error correction is used so that multiple devices transmitting at the same time can be detected (unless your protocol makes certain it cannot happen). But, still a CRC or checksum would be smart.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, the station->server communication will consist only of the "cool, i got your nice paket", or "help! help! overload of the servo!", or "moving done".

...presented by 'r' , 'o' and 'd'...

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, don't forget that every station on the BUS adds C, which slows down rise time. Fall time still fast due to transistor. Every listener adds C to the transmit bus and every talker adds C to the return bus. Also, wire run increases C for both.

You wil need to make sure that the bit time is slow compared to the RC timecostant of your line. You can also reduce the pullup R down to 1K with little problem.

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Errr - does TXD from the AVR (or any uart for that matter) idle high? In which case we need an inverter for the published circuit to work.

Personally, I'd just use RS485 transceivers and be done with it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Agree with Kartman! In async UART mode, idle is HIGH.

Could use a PNP/Pchan with the emitter/source connected to +5V and pulldown resistor to ground. Then, the transistor would be off during idle.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, this is solved. At the end of the bus, there will be an invertor.

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Really? Solved? If you use the Txd as it comes from the AVR, the AVRs that aren't transmitting will hold down the bus! No data will be transmitted. Thus it won't work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daqq wrote:
Well, this is solved. At the end of the bus, there will be an invertor.

No, it is not solved. You must place inverter before each of the transistors.
Simpler solution was suggested before. Use pnp transistor or P-chanell MOSFET.
Also, you need only one resistor from power supply to the bus.

Hope this helps.

Pop

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oops! Thanks for the warning!

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
On each station a pullup resistor is connected to a central bus.

If you connect 100 station on the bus then
Icollector= VCC/(Rpullup / 100) = 0,5A
Alexander

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

i like the single logic.
AFAIK there are open collector drivers without inversion....

Single chip (SOT23-5) solution....

Quote:
Also, don't forget that every station on the BUS adds C, which slows down rise time.

This may be true or not. It depends wether only one pullup is installed or every station has a pullup...

Bus conflicts are easily recognized, because you get a local hardware echo. If the readback is not what you have sent, then an error occured..

Quote:
If you connect 100 station on the bus then
Icollector= VCC/(Rpullup / 100) = 0,5A
my calculator says 50mA

Klaus
********************************
Look at: www.megausb.de (German)
********************************

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. Rpullup = 1kOm
2. You need only 2 Rpullup at the ends of the bus (as terninators)
3. Add jumper to disconnect Rpullup

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want can use a soft UART, and the data line is not over long lengths of wire, you can always make an open collector output from the AVR directly. Use the DDR register instead of the output PORT register. Set the PORT pin low on startup, then when you change the DDR bit to a 1, the output goes low. DDR bit zero, and it is an input or high impedance. This way, each AVR on the bus can also read every mesage - on a single bit.

official AVR Consultant
www.veruslogic.com