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

Communication whit Robonova through port serial

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
11 postsPage 1 of 1
11 postsPage 1 of 1

Communication whit Robonova through port serial

Post by elizabeth1086 » Mon Jun 11, 2007 2:05 am

Post by elizabeth1086
Mon Jun 11, 2007 2:05 am

Hi. I hope that you can help me.
I realize a program in C that send a byte through of the serial port to the Robonova and this receive too trouhg serial port but this not work. I don't know that I'm realize wrong.

I use a Max232 to convert the voltage, but in the moment in that I connect the signal of gnd and erx, the headlight of the robonova turn on but this not realize nothing when i sed it a data.
I connect the signal gnd in the pin corresponding of the three that have this. I don´t connected the middle pin because I supply the voltage to the max apart, in the pin of signal I connec the cable rx.

Here the program in C and the program in Robobasic.

Code in Turbo C

Code: Select all
#include <stdio>
#include <dos>
#include <conio>

#define COM1 0x3F8

void inicializar_puerto ();

void main()
{
   int valor,i;
   unsigned char tecla;
   clrscr();
   inicializar_puerto();
   gotoxy(20,5); printf("EJECUCION DE RUTINAS DEL ROBONOVA");
   gotoxy(6,10); printf("1.-Dar un paso con pie izquierdo.");
   gotoxy(6,12); printf("2.-Dar un paso con pie derecho.");
   gotoxy(6,14); printf("3.-Levantar mano derecha.");
   gotoxy(6,16); printf("4.-Levantar mano izquierda.");
   gotoxy(9,18); printf("Selecciona una Rutina: ");
   scanf("%d",&valor);
   switch(valor)
      {
      case 1:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Da un paso con pie izquierdo");
        break;
      case 2:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Da un paso con pie derecho");
        break;
      case 3:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Levanta mano derecha");
        break;
      case 4:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Levanta mano izquierda");
        break;
      default:
        for (i=7; i<8; i++)
        {
         textattr(i + ((i+1) <<4));
         gotoxy(18,22);cprintf("­Debes introducir un n£mero del 1 al 4!");
        }
        break;
      }
   getche();
}
void inicializar_puerto()
{
   outportb(COM1+1,0);
   outportb(COM1+3,0x80);
   outportb(COM1+0,0x0C);
   outportb(COM1+1,0x00);
   outportb(COM1+3,0x03);
   outportb(COM1+2,0xC7);
   outportb(COM1+4,0x0B);

}


<BR>


<BR>
Code in RoboBasic
Code: Select all
'==============================================================                      
'==============================================================

DIM RxIn AS BYTE
DIM A AS BYTE

'PTP -> Función ON/OFF para el control simultaneo de servos
PTP SETON 'Establecer la función de PTP como grupos
PTP ALLON 'Establecer la función de PTP para todos los servos

'Dirección inicial de los servos
'0->rotación contraria/gira a la izquierda
'1->rotacion normal/gira a la derecha
DIR G6A, 1,0,0,1,0,0
DIR G6B, 1,1,1,1,1,1
DIR G6C, 0,0,0,0,0,0
DIR G6D, 0,1,1,0,1,0

ZERO G6A,102,  93,  93, 107, 100
ZERO G6B,100, 102, 102
ZERO G6C,100, 102,  99
ZERO G6D, 99, 100, 100, 106, 102


'Leer la posición presente de los servos antes del encendido
'inicial y entonces designar la acción suavemente segun el
'comando move.
'1->Lee el valor presente del servo seleccionado y mantiene el
'estado presente del robot.
'0->mueve al valor inicial de el controlador la cual es 100
GETMOTORSET G6A, 1,1,1,1,1,0
GETMOTORSET G6B, 1,1,1,0,0,0
GETMOTORSET G6C, 1,1,1,0,0,0
GETMOTORSET G6D, 1,1,1,1,1,0

'Coloca la velocidad de los servos a 5
SPEED 5

'Fijar los servos que serán utilizados.
MOTOR G24

GOSUB POS_INICIAL
DELAY 1000
'==============================================================

MAIN:

   Retry:
   ERX 9600, RxIn, Retry   'Lee el puerto serie si no recibe
                     'vuelve al intentarlo.
   IF RxIn=1 THEN
      GOSUB RUTINAN1         'Da un paso izquierdo
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIn=2 THEN
      GOSUB RUTINAN2      'Da un paso derecho
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIn=3 THEN
      GOSUB RUTINAN3      'Levanta mano derecha.
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIN=4 THEN
      GOSUB RUTINAN4        'Levanta mano izquierda
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIn=27 THEN
      GOTO SALIR
   ENDIF   
   GOTO MAIN

SALIR:
   END

'==============================================================
'RUTINAS DEL ROBONOVA-1                                =
'==============================================================

'Paso izquierdo
RUTINAN1:
SPEED 5
MOVE24  85,  71, 152,  91, 112,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 112,  76, 145,  93,  92,  60,
   
SPEED 14
'left up
MOVE24  90, 107, 105, 105, 114,  60,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 114,  76, 145,  93,  90,  60,

'left down
MOVE24  90,  56, 143, 122, 114,  60,  80,  40,  80,    ,    ,    , 105,  40,  80,    ,    ,    , 113,  80, 145,  90,  90,  60,
MOVE24  90,  46, 163, 112, 114,  60,  80,  40,  80,    ,    ,    , 105,  40,  80,    ,    ,    , 112,  80, 145,  90,  90,  60,
   
SPEED 10
'left center
MOVE24 100,  66, 141, 113, 100, 100,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 100,  83, 156,  80, 100, 100,
MOVE24 113,  78, 142, 105,  90,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    ,  90, 102, 136,  85, 114,  60,

SPEED 14
'right up
MOVE24 113,  76, 145,  93,  90,  60, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    ,  90, 107, 105, 105, 114,  60,
RETURN

'Paso derecho
RUTINAN2:
'right up
MOVE24 113,  76, 145,  93,  90,  60, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    ,  90, 107, 105, 105, 114,  60,

'right down
MOVE24 113,  80, 145,  90,  90,  60, 105,  40,  80,    ,    ,    ,  80,  40,  80,    ,    ,    ,  90,  56, 143, 122, 114,  60,
MOVE24 112,  80, 145,  90,  90,  60, 105,  40,  80,    ,    ,    ,  80,  40,  80,    ,    ,    ,  90,  46, 163, 112, 114,  60,
      
SPEED 10
'right center
MOVE24 100,  83, 156,  80, 100, 100, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    , 100,  66, 141, 113, 100, 100,
MOVE24  90, 102, 136,  85, 114,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 113,  78, 142, 105,  90,  60,
      
SPEED 14
'left up
MOVE24  90, 107, 105, 105, 114,  60,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 113,  76, 145,  93,  90,  60,

SPEED 5
MOVE24  85,  71, 152,  91, 112,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 112,  76, 145,  93,  92,  60,
   
RETURN

'Levanta brazo derecho
RUTINAN3:
   SPEED 5
   
   MOVE G6A,101,  76, 145,  94,  99, 100
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,166,  16,  81, 100, 100, 100
   MOVE G6D,100,  75, 143,  94,  98, 100
   
   DELAY 1000
   
   MOVE G6A,102,  76, 145,  95,  99, 100
   MOVE G6B,100,  30,  81, 100, 100, 100
   MOVE G6C,100,  30,  80, 100, 100, 100
   MOVE G6D,101,  75, 140,  96,  96, 100
   RETURN


'Levanta Brazo izquierdo
RUTINAN4:
   SPEED 5
   
   MOVE G6A,102,  76, 145,  95,  99, 100
   MOVE G6B,164,  21,  81, 100, 100, 100
   MOVE G6C,101,  31,  81, 100, 100, 100
   MOVE G6D,101,  75, 139,  97,  96, 100
   DELAY 1000

   MOVE G6A,102,  76, 145,  95,  99, 100
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,102,  32,  82, 100, 100, 100
   MOVE G6D,101,  75, 138,  98,  96, 100
   RETURN

POS_INICIAL:
'Posición inicial del robot.
'El comando MOVE opera un servo al ángulo deseado, el ángulo
'del motor esta entre 10-190.

   MOVE G6A,100,  76, 145,  93, 100, 100
   MOVE G6D,100,  76, 145,  93, 100, 100 
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,100,  30,  80, 100, 100, 100
   WAIT
   RETURN
   


<BR>
Hi. I hope that you can help me.
I realize a program in C that send a byte through of the serial port to the Robonova and this receive too trouhg serial port but this not work. I don't know that I'm realize wrong.

I use a Max232 to convert the voltage, but in the moment in that I connect the signal of gnd and erx, the headlight of the robonova turn on but this not realize nothing when i sed it a data.
I connect the signal gnd in the pin corresponding of the three that have this. I don´t connected the middle pin because I supply the voltage to the max apart, in the pin of signal I connec the cable rx.

Here the program in C and the program in Robobasic.

Code in Turbo C

Code: Select all
#include <stdio>
#include <dos>
#include <conio>

#define COM1 0x3F8

void inicializar_puerto ();

void main()
{
   int valor,i;
   unsigned char tecla;
   clrscr();
   inicializar_puerto();
   gotoxy(20,5); printf("EJECUCION DE RUTINAS DEL ROBONOVA");
   gotoxy(6,10); printf("1.-Dar un paso con pie izquierdo.");
   gotoxy(6,12); printf("2.-Dar un paso con pie derecho.");
   gotoxy(6,14); printf("3.-Levantar mano derecha.");
   gotoxy(6,16); printf("4.-Levantar mano izquierda.");
   gotoxy(9,18); printf("Selecciona una Rutina: ");
   scanf("%d",&valor);
   switch(valor)
      {
      case 1:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Da un paso con pie izquierdo");
        break;
      case 2:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Da un paso con pie derecho");
        break;
      case 3:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Levanta mano derecha");
        break;
      case 4:
        outportb(COM1,valor);
        gotoxy(6,21); printf("ROBONOVA-1 Levanta mano izquierda");
        break;
      default:
        for (i=7; i<8; i++)
        {
         textattr(i + ((i+1) <<4));
         gotoxy(18,22);cprintf("­Debes introducir un n£mero del 1 al 4!");
        }
        break;
      }
   getche();
}
void inicializar_puerto()
{
   outportb(COM1+1,0);
   outportb(COM1+3,0x80);
   outportb(COM1+0,0x0C);
   outportb(COM1+1,0x00);
   outportb(COM1+3,0x03);
   outportb(COM1+2,0xC7);
   outportb(COM1+4,0x0B);

}


<BR>


<BR>
Code in RoboBasic
Code: Select all
'==============================================================                      
'==============================================================

DIM RxIn AS BYTE
DIM A AS BYTE

'PTP -> Función ON/OFF para el control simultaneo de servos
PTP SETON 'Establecer la función de PTP como grupos
PTP ALLON 'Establecer la función de PTP para todos los servos

'Dirección inicial de los servos
'0->rotación contraria/gira a la izquierda
'1->rotacion normal/gira a la derecha
DIR G6A, 1,0,0,1,0,0
DIR G6B, 1,1,1,1,1,1
DIR G6C, 0,0,0,0,0,0
DIR G6D, 0,1,1,0,1,0

ZERO G6A,102,  93,  93, 107, 100
ZERO G6B,100, 102, 102
ZERO G6C,100, 102,  99
ZERO G6D, 99, 100, 100, 106, 102


'Leer la posición presente de los servos antes del encendido
'inicial y entonces designar la acción suavemente segun el
'comando move.
'1->Lee el valor presente del servo seleccionado y mantiene el
'estado presente del robot.
'0->mueve al valor inicial de el controlador la cual es 100
GETMOTORSET G6A, 1,1,1,1,1,0
GETMOTORSET G6B, 1,1,1,0,0,0
GETMOTORSET G6C, 1,1,1,0,0,0
GETMOTORSET G6D, 1,1,1,1,1,0

'Coloca la velocidad de los servos a 5
SPEED 5

'Fijar los servos que serán utilizados.
MOTOR G24

GOSUB POS_INICIAL
DELAY 1000
'==============================================================

MAIN:

   Retry:
   ERX 9600, RxIn, Retry   'Lee el puerto serie si no recibe
                     'vuelve al intentarlo.
   IF RxIn=1 THEN
      GOSUB RUTINAN1         'Da un paso izquierdo
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIn=2 THEN
      GOSUB RUTINAN2      'Da un paso derecho
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIn=3 THEN
      GOSUB RUTINAN3      'Levanta mano derecha.
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIN=4 THEN
      GOSUB RUTINAN4        'Levanta mano izquierda
      DELAY 1000
      GOSUB POS_INICIAL   'Se coloca en la posición estandar.
   ELSEIF RxIn=27 THEN
      GOTO SALIR
   ENDIF   
   GOTO MAIN

SALIR:
   END

'==============================================================
'RUTINAS DEL ROBONOVA-1                                =
'==============================================================

'Paso izquierdo
RUTINAN1:
SPEED 5
MOVE24  85,  71, 152,  91, 112,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 112,  76, 145,  93,  92,  60,
   
SPEED 14
'left up
MOVE24  90, 107, 105, 105, 114,  60,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 114,  76, 145,  93,  90,  60,

'left down
MOVE24  90,  56, 143, 122, 114,  60,  80,  40,  80,    ,    ,    , 105,  40,  80,    ,    ,    , 113,  80, 145,  90,  90,  60,
MOVE24  90,  46, 163, 112, 114,  60,  80,  40,  80,    ,    ,    , 105,  40,  80,    ,    ,    , 112,  80, 145,  90,  90,  60,
   
SPEED 10
'left center
MOVE24 100,  66, 141, 113, 100, 100,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 100,  83, 156,  80, 100, 100,
MOVE24 113,  78, 142, 105,  90,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    ,  90, 102, 136,  85, 114,  60,

SPEED 14
'right up
MOVE24 113,  76, 145,  93,  90,  60, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    ,  90, 107, 105, 105, 114,  60,
RETURN

'Paso derecho
RUTINAN2:
'right up
MOVE24 113,  76, 145,  93,  90,  60, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    ,  90, 107, 105, 105, 114,  60,

'right down
MOVE24 113,  80, 145,  90,  90,  60, 105,  40,  80,    ,    ,    ,  80,  40,  80,    ,    ,    ,  90,  56, 143, 122, 114,  60,
MOVE24 112,  80, 145,  90,  90,  60, 105,  40,  80,    ,    ,    ,  80,  40,  80,    ,    ,    ,  90,  46, 163, 112, 114,  60,
      
SPEED 10
'right center
MOVE24 100,  83, 156,  80, 100, 100, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    , 100,  66, 141, 113, 100, 100,
MOVE24  90, 102, 136,  85, 114,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 113,  78, 142, 105,  90,  60,
      
SPEED 14
'left up
MOVE24  90, 107, 105, 105, 114,  60,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 113,  76, 145,  93,  90,  60,

SPEED 5
MOVE24  85,  71, 152,  91, 112,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 112,  76, 145,  93,  92,  60,
   
RETURN

'Levanta brazo derecho
RUTINAN3:
   SPEED 5
   
   MOVE G6A,101,  76, 145,  94,  99, 100
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,166,  16,  81, 100, 100, 100
   MOVE G6D,100,  75, 143,  94,  98, 100
   
   DELAY 1000
   
   MOVE G6A,102,  76, 145,  95,  99, 100
   MOVE G6B,100,  30,  81, 100, 100, 100
   MOVE G6C,100,  30,  80, 100, 100, 100
   MOVE G6D,101,  75, 140,  96,  96, 100
   RETURN


'Levanta Brazo izquierdo
RUTINAN4:
   SPEED 5
   
   MOVE G6A,102,  76, 145,  95,  99, 100
   MOVE G6B,164,  21,  81, 100, 100, 100
   MOVE G6C,101,  31,  81, 100, 100, 100
   MOVE G6D,101,  75, 139,  97,  96, 100
   DELAY 1000

   MOVE G6A,102,  76, 145,  95,  99, 100
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,102,  32,  82, 100, 100, 100
   MOVE G6D,101,  75, 138,  98,  96, 100
   RETURN

POS_INICIAL:
'Posición inicial del robot.
'El comando MOVE opera un servo al ángulo deseado, el ángulo
'del motor esta entre 10-190.

   MOVE G6A,100,  76, 145,  93, 100, 100
   MOVE G6D,100,  76, 145,  93, 100, 100 
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,100,  30,  80, 100, 100, 100
   WAIT
   RETURN
   


<BR>
Last edited by elizabeth1086 on Thu Mar 19, 2009 8:01 am, edited 1 time in total.
elizabeth1086
Robot Builder
Robot Builder
Posts: 12
Joined: Sun Jun 03, 2007 11:29 pm

Can Some translate the Spanish comments?

Post by Gort » Wed Jun 13, 2007 4:44 pm

Post by Gort
Wed Jun 13, 2007 4:44 pm

If some one could translate the Spanish comments in the C code it could make it easier to help? In the C code the switch statement dose not look right. When is a value moved into valor and I am not sure if the syntax is correct? I need to look at it more and walk through what it is doing. C is not one of my strong languages. Also Could it be in the way the serial connection is hocked up?
If some one could translate the Spanish comments in the C code it could make it easier to help? In the C code the switch statement dose not look right. When is a value moved into valor and I am not sure if the syntax is correct? I need to look at it more and walk through what it is doing. C is not one of my strong languages. Also Could it be in the way the serial connection is hocked up?
Gort
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by Gort » Wed Jun 13, 2007 5:00 pm

Post by Gort
Wed Jun 13, 2007 5:00 pm

Is the robonova getting the value of RxIn in the Robobasic statement:

Retry:
ERX 9600, RxIn, Retry
Is the robonova getting the value of RxIn in the Robobasic statement:

Retry:
ERX 9600, RxIn, Retry
Gort
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by Gort » Wed Jun 13, 2007 7:43 pm

Post by Gort
Wed Jun 13, 2007 7:43 pm

after further review, it looks like the C code is correct. I am still not sure How Robobasic is getting the value of the byte passed to it by the serial port?
after further review, it looks like the C code is correct. I am still not sure How Robobasic is getting the value of the byte passed to it by the serial port?
Gort
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by elizabeth1086 » Thu Jun 14, 2007 5:49 am

Post by elizabeth1086
Thu Jun 14, 2007 5:49 am

Hi Gort.
Thanks for check my code. Look I need that Robonova receive for the serial port the byte that i send through to the Pc with the code in C.
In the code RoboBasic I put this line:

Retry:
ERX, 9600, RxIn, Retry

I supposed that whit this line, RoboBasic would receive the byte, but I don't know if this is right.

Other problem it's that I connected the serial cable to the pin ERX throug max232 for regular the voltage, but this not work. I don`t know if the connection whit the pin ERX is right because I don't know like robonova interpret that serial port it's.

I see that exist the port serial whit which i program the robot and the port serial that the controller has, using the pins marked like ERX y TX. I don´t know how recognize that port is?

Sorry, my english isn't very good!.
Hi Gort.
Thanks for check my code. Look I need that Robonova receive for the serial port the byte that i send through to the Pc with the code in C.
In the code RoboBasic I put this line:

Retry:
ERX, 9600, RxIn, Retry

I supposed that whit this line, RoboBasic would receive the byte, but I don't know if this is right.

Other problem it's that I connected the serial cable to the pin ERX throug max232 for regular the voltage, but this not work. I don`t know if the connection whit the pin ERX is right because I don't know like robonova interpret that serial port it's.

I see that exist the port serial whit which i program the robot and the port serial that the controller has, using the pins marked like ERX y TX. I don´t know how recognize that port is?

Sorry, my english isn't very good!.
elizabeth1086
Robot Builder
Robot Builder
Posts: 12
Joined: Sun Jun 03, 2007 11:29 pm

Post by elizabeth1086 » Fri Jun 15, 2007 12:09 am

Post by elizabeth1086
Fri Jun 15, 2007 12:09 am

Hi Gort .
Another quiestion:

I need put this line for that controller receive throug port serial
RxIn=BYTEIN(port number).?

But like know that port number is the port ERX?
Hi Gort .
Another quiestion:

I need put this line for that controller receive throug port serial
RxIn=BYTEIN(port number).?

But like know that port number is the port ERX?
elizabeth1086
Robot Builder
Robot Builder
Posts: 12
Joined: Sun Jun 03, 2007 11:29 pm

Post by elizabeth1086 » Fri Jun 15, 2007 12:09 am

Post by elizabeth1086
Fri Jun 15, 2007 12:09 am

Hi Gort .
Another quiestion:

I need put this line for that controller receive throug port serial
RxIn=BYTEIN(port number).?

But like know that port number is the port ERX?
Hi Gort .
Another quiestion:

I need put this line for that controller receive throug port serial
RxIn=BYTEIN(port number).?

But like know that port number is the port ERX?
elizabeth1086
Robot Builder
Robot Builder
Posts: 12
Joined: Sun Jun 03, 2007 11:29 pm

Post by elizabeth1086 » Fri Jun 15, 2007 12:10 am

Post by elizabeth1086
Fri Jun 15, 2007 12:10 am

Hi Gort .
Another quiestion:

I need put this line for that controller receive throug port serial
RxIn=BYTEIN(port number), or RxIn=IN(port number)?

But how I know that port number is the port ERX?
Hi Gort .
Another quiestion:

I need put this line for that controller receive throug port serial
RxIn=BYTEIN(port number), or RxIn=IN(port number)?

But how I know that port number is the port ERX?
elizabeth1086
Robot Builder
Robot Builder
Posts: 12
Joined: Sun Jun 03, 2007 11:29 pm

Post by Pev » Fri Jun 15, 2007 7:51 am

Post by Pev
Fri Jun 15, 2007 7:51 am

Hi


the code :

Retry:
ERX, 9600, RxIn, Retry

Looks right to me - it says recieve a byte from ERX at 9600 baud into variable RxIn and goto retry if it fails

When I first played with the ERX/ETX ports I had a lot of issues working out which port was which, they do not seem to be logically labelled and I ended up reversing the TX/RX connections to what seemed to be the wrong way but it worked.

Have you tried swapping TX and RX connections to the MR-C3024 around?

Pev
Hi


the code :

Retry:
ERX, 9600, RxIn, Retry

Looks right to me - it says recieve a byte from ERX at 9600 baud into variable RxIn and goto retry if it fails

When I first played with the ERX/ETX ports I had a lot of issues working out which port was which, they do not seem to be logically labelled and I ended up reversing the TX/RX connections to what seemed to be the wrong way but it worked.

Have you tried swapping TX and RX connections to the MR-C3024 around?

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by i-Bot » Fri Jun 15, 2007 8:36 am

Post by i-Bot
Fri Jun 15, 2007 8:36 am

You need to debug the connection in parts.

It is along time since I saw a serial program which writes direct to UART registers. This makes me suspicious of the PC part. I suggest to add a read from the com port and printf within the PC program. Then test in loop- back first on the RS232 TX and RX, then the TTL level conections normally connected to the C3024. If both of these work, then look to the Robobasic code, or swap the connections as Pev suggests.

If the RS232 loopback works and the TTL does not, then suspect the Max232 circuit. If you want to connect by wire from PC to Robonova, you can do this simply with the standard serial cable. Make sure Robobasic is not runing on PC, so serial port is free. Any character between 0 and 0x7f which is sent to the serial cable connected to the RoboNova will automatically appear in the first defined variable (RxIn in your program). 0xFF is also passed, but do not use values between 0x80 and 0xFE, since these are serial commands.
You need to debug the connection in parts.

It is along time since I saw a serial program which writes direct to UART registers. This makes me suspicious of the PC part. I suggest to add a read from the com port and printf within the PC program. Then test in loop- back first on the RS232 TX and RX, then the TTL level conections normally connected to the C3024. If both of these work, then look to the Robobasic code, or swap the connections as Pev suggests.

If the RS232 loopback works and the TTL does not, then suspect the Max232 circuit. If you want to connect by wire from PC to Robonova, you can do this simply with the standard serial cable. Make sure Robobasic is not runing on PC, so serial port is free. Any character between 0 and 0x7f which is sent to the serial cable connected to the RoboNova will automatically appear in the first defined variable (RxIn in your program). 0xFF is also passed, but do not use values between 0x80 and 0xFE, since these are serial commands.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by elizabeth1086 » Mon Jun 18, 2007 6:40 pm

Post by elizabeth1086
Mon Jun 18, 2007 6:40 pm

Hi Guys:
I tried swapping TX and Rx connections to the MR-C3024, but it didn't work.
I look that RX and TX to the MR-C3024 is in high voltage 5V and I have a doubt: The pin RX must be in 5V but the pin TX mustn't in 5V?. I suppose that the RX must be in 5V because always ought to be receiving data.
But I look that both is in high. I don't know if I'm wrong.

I will try agian swapping RX and Tx and debug the connection in parts.

Thanks, we will follow in contact.
Hi Guys:
I tried swapping TX and Rx connections to the MR-C3024, but it didn't work.
I look that RX and TX to the MR-C3024 is in high voltage 5V and I have a doubt: The pin RX must be in 5V but the pin TX mustn't in 5V?. I suppose that the RX must be in 5V because always ought to be receiving data.
But I look that both is in high. I don't know if I'm wrong.

I will try agian swapping RX and Tx and debug the connection in parts.

Thanks, we will follow in contact.
elizabeth1086
Robot Builder
Robot Builder
Posts: 12
Joined: Sun Jun 03, 2007 11:29 pm


11 postsPage 1 of 1
11 postsPage 1 of 1