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

Should I make the jump???

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
36 postsPage 3 of 31, 2, 3
36 postsPage 3 of 31, 2, 3

Post by pepperm » Sun Sep 03, 2006 8:03 pm

Post by pepperm
Sun Sep 03, 2006 8:03 pm

How about this as a starting point?

Image

I'll work on a PCB for it, I'm using the mega8 PDIP version at the moment because that is all that I have in my draw. I have some free 74HC126's on the way from Texas Instruments, and a local Atmel distributor may send me some SMD samples. I have asked.

Once we have some working code we can work on a better board, perhaps with different IO. I think this will work as a good development board though.

Mark
How about this as a starting point?

Image

I'll work on a PCB for it, I'm using the mega8 PDIP version at the moment because that is all that I have in my draw. I have some free 74HC126's on the way from Texas Instruments, and a local Atmel distributor may send me some SMD samples. I have asked.

Once we have some working code we can work on a better board, perhaps with different IO. I think this will work as a good development board though.

Mark
pepperm
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 190
Joined: Sat Jul 01, 2006 1:00 am

Post by pepperm » Sun Sep 03, 2006 9:20 pm

Post by pepperm
Sun Sep 03, 2006 9:20 pm

And this is the PCB.

Image

I'll make one as soon as I am back from my trip.

So now we need some code...............

Mark
And this is the PCB.

Image

I'll make one as soon as I am back from my trip.

So now we need some code...............

Mark
pepperm
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 190
Joined: Sat Jul 01, 2006 1:00 am

Post by limor » Sun Sep 03, 2006 9:43 pm

Post by limor
Sun Sep 03, 2006 9:43 pm

please excuse a software guy's humble ignorance.

I dont understand the serial communication wireing. To send a bit to the coms line, the MCU has to put PD0 on 0 and/or PD6 on 1? and similarly when the imcoming signal is high (or low) what happens to PD7 and PD1?
(Correction: sending data involves PD0 and PD6 / receiving involves PD7 and PD1.. but my question remains)
:oops:
please excuse a software guy's humble ignorance.

I dont understand the serial communication wireing. To send a bit to the coms line, the MCU has to put PD0 on 0 and/or PD6 on 1? and similarly when the imcoming signal is high (or low) what happens to PD7 and PD1?
(Correction: sending data involves PD0 and PD6 / receiving involves PD7 and PD1.. but my question remains)
:oops:
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by KurtE » Mon Sep 04, 2006 3:07 am

Post by KurtE
Mon Sep 04, 2006 3:07 am

limor wrote:please excuse a software guy's humble ignorance.

I dont understand the serial communication wireing. To send a bit to the coms line, the MCU has to put PD0 on 0 and/or PD6 on 1? and similarly when the imcoming signal is high (or low) what happens to PD7 and PD1?
(Correction: sending data involves PD0 and PD6 / receiving involves PD7 and PD1.. but my question remains)
:oops:


I believe that he is using two I/O pins PD6 and PD7 combined to form the direction port as shown in the CM-5 internal circuit (HALF DUPLEX UART). Their diagram uses an 74HC04 inverter to make sure that only TXD or RXD is active, but not both. In Mark's circuit the controlling software would have to make sure that only one of these two pins is set high at any point.

I assume that you will want to use the builtin USART support that is in the ATMEGA8 chip. So your code may look something like: (Note this code is sortof based off of the C++ classes that are defined in the Seattle Robotics Society Workshop robot level 2 examples. These are up at:
http://www.seattlerobotics.org/WorkshopRobot/level2/index.php

Code: Select all
OUT   RXEnable ('D', 6);
OUT   TXEnable ('D', 7, false);
COMM   comm      ('D', 0,
                  'D', 1);
 
...
// To output a packet you might try something like
RXEnable.Low();
TXEnable.High();

// For each byte in the packet you might call something like:
comm.TxCh(ch); // waits for bit_is_clear(UCSRA, UDRE)
                         // before setting UDR= ch

...
// To receive information you might do something like:
TxEnable.Low():
RxEnable.High();

// Set up a loop to read in a packet with all of the appropriate
// error checking...
while(!comm.IsCharWaiting()) ; // checks RXC bit in UCSRA
ch = comm.InKey();                 // gets byte from UDR register


Note in the example code above you could replace the polling for input character available or transmit complete with interrupts...

Please forgive me if I misunderstood the schematic as I am also a software guy!
limor wrote:please excuse a software guy's humble ignorance.

I dont understand the serial communication wireing. To send a bit to the coms line, the MCU has to put PD0 on 0 and/or PD6 on 1? and similarly when the imcoming signal is high (or low) what happens to PD7 and PD1?
(Correction: sending data involves PD0 and PD6 / receiving involves PD7 and PD1.. but my question remains)
:oops:


I believe that he is using two I/O pins PD6 and PD7 combined to form the direction port as shown in the CM-5 internal circuit (HALF DUPLEX UART). Their diagram uses an 74HC04 inverter to make sure that only TXD or RXD is active, but not both. In Mark's circuit the controlling software would have to make sure that only one of these two pins is set high at any point.

I assume that you will want to use the builtin USART support that is in the ATMEGA8 chip. So your code may look something like: (Note this code is sortof based off of the C++ classes that are defined in the Seattle Robotics Society Workshop robot level 2 examples. These are up at:
http://www.seattlerobotics.org/WorkshopRobot/level2/index.php

Code: Select all
OUT   RXEnable ('D', 6);
OUT   TXEnable ('D', 7, false);
COMM   comm      ('D', 0,
                  'D', 1);
 
...
// To output a packet you might try something like
RXEnable.Low();
TXEnable.High();

// For each byte in the packet you might call something like:
comm.TxCh(ch); // waits for bit_is_clear(UCSRA, UDRE)
                         // before setting UDR= ch

...
// To receive information you might do something like:
TxEnable.Low():
RxEnable.High();

// Set up a loop to read in a packet with all of the appropriate
// error checking...
while(!comm.IsCharWaiting()) ; // checks RXC bit in UCSRA
ch = comm.InKey();                 // gets byte from UDR register


Note in the example code above you could replace the polling for input character available or transmit complete with interrupts...

Please forgive me if I misunderstood the schematic as I am also a software guy!
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State

Post by pepperm » Mon Sep 04, 2006 6:29 am

Post by pepperm
Mon Sep 04, 2006 6:29 am

The serial comms circuitry is the same as that used on the AX-12 (if my tracing is accurate) which in turn is functionally the same as the one used on the CM-5. The CM-5 & AX-12s don't use a 7404 inverter but drive both enable lines directly from the processor. The 74126 is not an inverter it is a non inverting buffer. I'm not sure why they have done it this way, maybe because they use the other 2 buffer gates on the CM-5 to buffer and select the RS232 or Zigbee connections or so that the data is not inverted when it hits the processors.

The code in the example C code should explain the the use of the RS485 port and its enable lines, because although the code is for the CM-5 it would be very similar for the AX-12 and indeed AX-S1.

So to send data you need to set PD7 high. You could also set PD6 low but it wouldn't matter if it was high.

To receive data PD7 must be set low and PD6 high. Data comes in on Rxd and goes out on Txd. Exactly the same as on the AX-12 (unless my tracing went wrong again some where)

We could use an invertor in the select line but then we would probably need more chips on the board as we would still need a device that had enable inputs. We could use the inverting version of the 74126 but then the data would be inverted in the Mega8.

Do you think you can write code for this circuit?

Mark
The serial comms circuitry is the same as that used on the AX-12 (if my tracing is accurate) which in turn is functionally the same as the one used on the CM-5. The CM-5 & AX-12s don't use a 7404 inverter but drive both enable lines directly from the processor. The 74126 is not an inverter it is a non inverting buffer. I'm not sure why they have done it this way, maybe because they use the other 2 buffer gates on the CM-5 to buffer and select the RS232 or Zigbee connections or so that the data is not inverted when it hits the processors.

The code in the example C code should explain the the use of the RS485 port and its enable lines, because although the code is for the CM-5 it would be very similar for the AX-12 and indeed AX-S1.

So to send data you need to set PD7 high. You could also set PD6 low but it wouldn't matter if it was high.

To receive data PD7 must be set low and PD6 high. Data comes in on Rxd and goes out on Txd. Exactly the same as on the AX-12 (unless my tracing went wrong again some where)

We could use an invertor in the select line but then we would probably need more chips on the board as we would still need a device that had enable inputs. We could use the inverting version of the 74126 but then the data would be inverted in the Mega8.

Do you think you can write code for this circuit?

Mark
pepperm
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 190
Joined: Sat Jul 01, 2006 1:00 am

Post by pepperm » Tue Sep 05, 2006 8:02 am

Post by pepperm
Tue Sep 05, 2006 8:02 am

Also, re a new processor board. What about the AVR Butterfly. Mega 169, LCD, tones of I/O, very cheap at around £20
Also, re a new processor board. What about the AVR Butterfly. Mega 169, LCD, tones of I/O, very cheap at around £20
pepperm
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 190
Joined: Sat Jul 01, 2006 1:00 am

Previous
36 postsPage 3 of 31, 2, 3
36 postsPage 3 of 31, 2, 3