• Viernes 29 de Marzo de 2024, 09:15

Autor Tema:  Duda Con Ensamblador Y Micro Atmel  (Leído 2021 veces)

mguerrerop

  • Nuevo Miembro
  • *
  • Mensajes: 4
    • Ver Perfil
Duda Con Ensamblador Y Micro Atmel
« en: Miércoles 18 de Junio de 2008, 21:12 »
0
Hola a todos,

Estoy en la tediosa tarea de controlar un robot gobernado por un micro atmel  a través de un pc, y usando 2 radiomodems.
Para la programación del micro (un 89c52 de atmel) uso el programa Keil.
Os resumo brevemente mi problema.
En la hoja de características del radiomodem, viene la forma de configurarlo mediante comandos, bien mediante un programa específico, o bien a través del microcontrolador. Mi caso es el segundo, el del microcontrolador.
Os pongo unos cuantos ejemplos de las distintas cosas que se pueden configurar, y los comandos asociados:

Easy-Radio Configuration Command Set
The programming software sends ‘Text Commands’ to the modules and this action can be performed by terminal software or the host’s Microcontroller using the following list of commands:



 RF Power Output
Sets output power on a channel.
Warning! This level will be set to the default setting when the frequency is changed or reset via a Channel command.    
ER_CMD#P0           1mW
ER_CMD#P1       2Mw    
ER_CMD#P2       3mW    
ER_CMD#P3       4mW    
ER_CMD#P4       5mW    
ER_CMD#P5       6mW    
ER_CMD#P?    Get Power Value    The module replies with the power value. eg:
ER_CMD#P9
No ACK is required.

To successfully send a command do the following:
   1. Send Command from host: e.g. ER_CMD#U5 (Set UART BAUD to 38400)
   2. In the case of a TRS/RS:
   o Wait for echo of command from module. e.g. ER_CMD#U5
   In the case of a TS:
   o Wait 20mS
   3. Send the ASCII string from the host: ACK

The commands should be sent exactly as shown (case sensitive) with no spaces between characters. The ACK command is sent as three ASCII characters, ACK in sequence. ‘A’’C’’K’ .
Note that the TS (transmitter) devices send data ‘over air’ as they are not equipped with a serial data out or handshake pins. This takes approximately 20mS and time should be taken in to account before sending the ‘ACK’ sequence


Así, si por ejemplo quiero configurar el radiomodem para que transmita con 5mW de potencia, tendré que enviarle la cadena de texto ER_CMD#P4, esperar 20 ms, y enviarle la señal ACK.

Mi problema es: ¿cómo envío la cadena de texto ER_CMD#P4?
Supongamos que para enviar  la cadena de texto desde el micro al radiomodem, basta con enviarla a un registro cualquiera, por ejemplo R0, ¿cómo le paso la cadena de texto desde el micro al radiomodem, poniendo  MOV R0, #’ER_CMD#P4’ ?
Así da fallo, ¿sabeis alguno cómo hacerlo?

Gracias, y un saludo