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

Programming the serial port

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

Programming the serial port

Post by alonsoBrain » Tue Oct 23, 2007 11:06 am

Post by alonsoBrain
Tue Oct 23, 2007 11:06 am

Hi!

I'd like to connect the CM5 box with a serial device...

What is the best choice to make the CM5 to listen to the port?

1. An interrupt driven routine?
2. A simple loop as

while (true){
command =TxD8Hex (RXD1_DATA);
make_my_things(command);
}

?

Thank you in advance.
Hi!

I'd like to connect the CM5 box with a serial device...

What is the best choice to make the CM5 to listen to the port?

1. An interrupt driven routine?
2. A simple loop as

while (true){
command =TxD8Hex (RXD1_DATA);
make_my_things(command);
}

?

Thank you in advance.
Last edited by alonsoBrain on Thu Oct 25, 2007 7:49 am, edited 1 time in total.
alonsoBrain
Robot Builder
Robot Builder
User avatar
Posts: 13
Joined: Wed Sep 20, 2006 1:00 am

Post by alonsoBrain » Thu Oct 25, 2007 7:48 am

Post by alonsoBrain
Thu Oct 25, 2007 7:48 am

ok
I've tested the polling option at 57000 bps with great sucess
(the answer was here, in the forum)

Code: Select all
byte RxSerial (void){
  if (RXD1_READY) return(RXD1_DATA);
  else return (0x0);
}

main (void) {
  while(1){
   key = RxSerial () ;
   if (key != 0){
      if (key==KEY1) command = OP1 ;   
      if (key==KEY2) command = OP2 ;   
   }   
   if (command==OP1) make_my_things();

  }
}
:D :D
ok
I've tested the polling option at 57000 bps with great sucess
(the answer was here, in the forum)

Code: Select all
byte RxSerial (void){
  if (RXD1_READY) return(RXD1_DATA);
  else return (0x0);
}

main (void) {
  while(1){
   key = RxSerial () ;
   if (key != 0){
      if (key==KEY1) command = OP1 ;   
      if (key==KEY2) command = OP2 ;   
   }   
   if (command==OP1) make_my_things();

  }
}
:D :D
alonsoBrain
Robot Builder
Robot Builder
User avatar
Posts: 13
Joined: Wed Sep 20, 2006 1:00 am


2 postsPage 1 of 1
2 postsPage 1 of 1