Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] multi-drop slaves

2006-05-18 by David Collier

fred fred fred
X-Ameol-Version: 2.55.2048, Microsoft Windows XP Professional Service Pack 2 (Build 2600)

> You didn't say how far apart these slaves would be and what sort of 
> environment etc. If they are within a metre or two you could use TWI 
> aka I2C as this is well suited for low-speed local multi-drop. 
> Although I2C is not suited for long stretches I used to run LCD 
> displays off I2C over 10's of metres many years ago in harsh 
> environments, but this is not recommended practice :)

3 metres total, auto environment, 24V supply

I reckon I2C with a checksum would do it ... but LIN is a better 
standard, if I can do it without a h/w UART

> There is also SPI but not in the regular way which requires slave 
> selects etc. You can use it in two wire mode by multi-dropping the 
> clocks and the MOSI pins, forgetting the MISO as it becomes redundant.
> For the USI on the Tiny it looks like you need to join the DI and DO 
> together to achieve this. It's usually good practice to isolate each 
> pin via a small value resistor (I use 220R). Software leaves each 
> device in slave mode until one wants to talk, and provided there are 
> no collisions then each slave device gets the same message. When one 
> wants to reply, well it does the same thing and switches to master 
> mode temporarily. I have used this method on other micros at 
> high-speed for locally connected modules.

Hmmm... that would work... but does it end up with any advantage over 
s/w I2C? At least that defines a start and a stop condition.

> Also, the tinys do seem to work in half-duplex asynchronous mode, at 
> least according to the docs. This is the method I have used on other 
> micros where you can simply tie the txd and rxd of a uart together 
> (assuming txd can be tristated) and form a 1-wire asynchronous 
> multi-drop bus. Once again it is good practice to isolate the txd pin 
> with a small value resistor and include a high-value resistor and 
> optional filtering cap in the rxd pin for extra protection.

but I though there was only one tiny with a "true UART"???

> If you want distance then there are many options with RS485 being the 
> most common and quite doable on the tinys.

I'm not keen on adding the cost of a 485 transceiver, but it may come to 
that.

Many thanks 

David

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.