Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Proposed 3v AVR to 5v AX-12 interface

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
4 postsPage 1 of 1
4 postsPage 1 of 1

Proposed 3v AVR to 5v AX-12 interface

Post by Miamicanes » Fri Jun 20, 2008 5:47 am

Post by Miamicanes
Fri Jun 20, 2008 5:47 am

Does this circuit look like it will work for interfacing a (presumably 5v logic) AX-12 with an Atmel ATmega88 running at 3.0v, using a TI SNLVC1T45 level shifter?

Image

As I understand it, when the DIR pin is high, a 3v signal on the "A" pin creates a 5v signal on the "B" pin. When the DIR pin is low, a 5v signal on the "B" pin creates a 3v signal on the "A" pin.

Some of my main concerns (besides whether it will work at all...) are:

* I'm taking the "10k with 5v" resistor value as an article of faith based on the AX-12 manual's sample interface circuit. Should the resistor on the 3v side be 10k as well?

* Is there actually going to be enough time between the moment I finish transmitting and the moment the AX-12 sends back its response to clear the TxEnable bit, change PD2 from high to low, set the RxEnable bit, and have everything settle down to its proper state?

Now... playing Devil's Advocate for a moment, do I even HAVE to screw around with level conversion? Or can I safely connect the 3v Mega88's TX & RX pins directly to the AX-12's (presumably) 5v serial bus, and feel confident that something ELSE (like, say, a 3.0v ARM9) connected to the same AVR via SPI won't see or feel the metaphorical 5v tidal wave hitting the Rx pin and the tristated Tx pin on the AVR? I have to admit that interfacing 3v to 5v is one area where I feel really uncertain about what I can get away with, and something I've generally bent over backwards up to now to avoid at any and all cost. I'm fairly sure the AVR *itself* is probably 5v-tolerant when running at 3.0v, but I know almost nothing about how pumping 5v into one of its pins might affect other, less-tolerant and significantly more expensive, components connected to the same AVR.
Does this circuit look like it will work for interfacing a (presumably 5v logic) AX-12 with an Atmel ATmega88 running at 3.0v, using a TI SNLVC1T45 level shifter?

Image

As I understand it, when the DIR pin is high, a 3v signal on the "A" pin creates a 5v signal on the "B" pin. When the DIR pin is low, a 5v signal on the "B" pin creates a 3v signal on the "A" pin.

Some of my main concerns (besides whether it will work at all...) are:

* I'm taking the "10k with 5v" resistor value as an article of faith based on the AX-12 manual's sample interface circuit. Should the resistor on the 3v side be 10k as well?

* Is there actually going to be enough time between the moment I finish transmitting and the moment the AX-12 sends back its response to clear the TxEnable bit, change PD2 from high to low, set the RxEnable bit, and have everything settle down to its proper state?

Now... playing Devil's Advocate for a moment, do I even HAVE to screw around with level conversion? Or can I safely connect the 3v Mega88's TX & RX pins directly to the AX-12's (presumably) 5v serial bus, and feel confident that something ELSE (like, say, a 3.0v ARM9) connected to the same AVR via SPI won't see or feel the metaphorical 5v tidal wave hitting the Rx pin and the tristated Tx pin on the AVR? I have to admit that interfacing 3v to 5v is one area where I feel really uncertain about what I can get away with, and something I've generally bent over backwards up to now to avoid at any and all cost. I'm fairly sure the AVR *itself* is probably 5v-tolerant when running at 3.0v, but I know almost nothing about how pumping 5v into one of its pins might affect other, less-tolerant and significantly more expensive, components connected to the same AVR.
Miamicanes
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Dec 28, 2006 1:00 am

Post by JonHylands » Fri Jun 20, 2008 3:08 pm

Post by JonHylands
Fri Jun 20, 2008 3:08 pm

This might help:

http://www.sparkfun.com/commerce/product_info.php?products_id=8745

In terms of time to switch, it shouldn't be a problem - you should be able to switch from Tx to Rx mode in something like a micro-second, and the AX-12 is going to take longer than that to process your messages, and prepare a response.

I talked to my brother about this - my Bioloid I/O board comes with a 3.3 volt regulator, and I don't have a buffer. The AVR is not rated for it, but it seems to work. He felt the chip might end having a reduced lifetime, because you're potentially pulling too much current on those two pins. A current limiting resistor in series should help with that.

I can't say for sure one way or the other how the digital output pins could be affected by this. You're probably safer using a buffer...

- Jon
This might help:

http://www.sparkfun.com/commerce/product_info.php?products_id=8745

In terms of time to switch, it shouldn't be a problem - you should be able to switch from Tx to Rx mode in something like a micro-second, and the AX-12 is going to take longer than that to process your messages, and prepare a response.

I talked to my brother about this - my Bioloid I/O board comes with a 3.3 volt regulator, and I don't have a buffer. The AVR is not rated for it, but it seems to work. He felt the chip might end having a reduced lifetime, because you're potentially pulling too much current on those two pins. A current limiting resistor in series should help with that.

I can't say for sure one way or the other how the digital output pins could be affected by this. You're probably safer using a buffer...

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by Miamicanes » Fri Jun 20, 2008 4:03 pm

Post by Miamicanes
Fri Jun 20, 2008 4:03 pm

Yeah, I actually saw the Sparkfun board last night. Any opinion of whether it's better/worse/essentially identical to the 74LVC1T45 as far as performance, etc is concerned?

It's a shame TI hasn't spun off a line of "Little Logic" chips that incorporate BOTH functions... whatever logic/gate function they do AND the level shifting. For example, they have one (74LVC1G126) that's basically a 74xx126 with a single gate. It would have been awesome if they took it a step further, added another pin for VccB, and ended up with a chip that would have basically been a 74lvc1t45 with OE.
Yeah, I actually saw the Sparkfun board last night. Any opinion of whether it's better/worse/essentially identical to the 74LVC1T45 as far as performance, etc is concerned?

It's a shame TI hasn't spun off a line of "Little Logic" chips that incorporate BOTH functions... whatever logic/gate function they do AND the level shifting. For example, they have one (74LVC1G126) that's basically a 74xx126 with a single gate. It would have been awesome if they took it a step further, added another pin for VccB, and ended up with a chip that would have basically been a 74lvc1t45 with OE.
Miamicanes
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Dec 28, 2006 1:00 am

Post by JonHylands » Fri Jun 20, 2008 5:04 pm

Post by JonHylands
Fri Jun 20, 2008 5:04 pm

I have no idea, sorry - logic chips (and electronics in general) are definitely not my thing.

- Jon
I have no idea, sorry - logic chips (and electronics in general) are definitely not my thing.

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada


4 postsPage 1 of 1
4 postsPage 1 of 1