To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 4015
4014  |  4016
Subject: 
RCX Serial Hardware Hack
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 20 May 2008 05:48:00 GMT
Viewed: 
25029 times
  
Hi

As allready described in a other thread i have build a bluetoothconnection
between pc and the RCX.
There is one thing that the serial bluetooth is only available to tx/rx with a
minimum from 4800 baud.
At first i compiled brickos 0.9.0 with
#define CONF_LNP_FAST  //!< enable 4800 bps LNP in boot/config.h and
util/dll-src

Downlad of brickos.srec was successfull but i had allmost no success to download
the programs with 4800 baud.
Maybe it is the usb to serial coverter for the serial Tower.
The usb tower has no option for that in standart dll. ( Only with c++ pn Windows
but there is no feature to define the

parity bit)

So i changed the kernel and write a program to switch from the rcx from 2400 to
4800 baud.
This was sucessfull.

brickos:
include\lnp\sys\lnp-locigal.h

extern unsigned short lnp_logical_baud_rate;
extern unsigned short lnp_logical_parity;
extern unsigned short lnp_byte_safe;
extern unsigned short lnp_wait_txok;
extern unsigned short lnp_wait_coll;

kernel\lnp-locigal.c
unsigned short lnp_logical_baud_rate=LNP_LOGICAL_BAUD_RATE; // ok
unsigned short lnp_logical_parity =LNP_LOGICAL_PARITY;
unsigned short lnp_byte_safe = LNP_BYTE_SAFE;
unsigned short lnp_wait_txok = LNP_WAIT_TXOK;
unsigned short lnp_wait_coll = LNP_WAIT_COLL;

change:
  S_MR =lnp_logical_parity;
  S_BRR=lnp_logical_baud_rate;
and so on for safe txok and coll




rcx program:

#include <lnp.h>
#include <lnp-logical.h>
#include <sys/lnp-logical.h>
#include <sys/lnp.h>
#include <sys/h8.h>

void baud2400() {
   unsigned short lnp_byte_time      =  MSECS_TO_TICKS(5);          //!< 2400
baud
   unsigned short lnp_byte_timeout   =   (3*lnp_byte_time/2);      //!< timeout waiting for a byte
   unsigned short lnp_byte_safe_temp =   (4*lnp_byte_time);    //!< delay before transmitting a b yte
   unsigned short lnp_wait_txok_temp =   (2*lnp_byte_timeout); //!< delay after good transmit
   unsigned short lnp_wait_coll_temp =   (4*lnp_byte_timeout); //!< delay after collision

   lnp_logical_baud_rate = B2400;
   lnp_logical_parity =    SMR_P_ODD;
   lnp_byte_safe = lnp_byte_safe_temp;
   lnp_wait_txok = lnp_wait_txok_temp;
   lnp_wait_coll = lnp_wait_coll_temp;
}

void baud4800() {
   unsigned short lnp_byte_time = MSECS_TO_TICKS(3);          //!< 4800 baud
   unsigned short lnp_byte_timeout   =   (3*lnp_byte_time/2);      //!< timeout waiting for a byte
   unsigned short lnp_byte_safe_temp =   (4*lnp_byte_time);    //!< delay before transmitting a b yte
   unsigned short lnp_wait_txok_temp =   (2*lnp_byte_timeout); //!< delay after good transmit
   unsigned short lnp_wait_coll_temp =   (4*lnp_byte_timeout); //!< delay after collision

   lnp_logical_baud_rate = B4800;
   lnp_logical_parity =    SMR_P_NONE;
   lnp_byte_safe = lnp_byte_safe_temp;
   lnp_wait_txok = lnp_wait_txok_temp;
   lnp_wait_coll = lnp_wait_coll_temp;
}



I have done also the Hardware hack from
http://www.convict.lu/Jeunes/RCXCam/RCXCam_Journal.htm

I search for the orignal hack but the link is dead
http://www-date.uni-paderborn.de/pub/people/dasas/Beh03.pdf

Then i have done as it is discriped in
http://www.convict.lu/Jeunes/RCXCam/RCXCam_Journal.htm
but i dont understand realy why we should do that?

1) To correctly use the H8 TX line with the CMUCam2 module, the driving RCX
software MUST shut down the 38kHz carrier

like :

   void infrared_off()      {
//! disable IR carrier frequency.    // carrier_shutdown();
//extern inline void carrier_shutdown(void)
  T1_CR  =0;
  T1_CSR =0;
  }

and
2)set the port6<7> pin LOW. Now the upper PNP transistor isn't conducting
anymore.

FOR WHAT reason i should do that. Maybe because the TX pin of the hitachi can
only drive only 1 TTL Load and a 30pf

load?? it is descriped in the HW Manual for the Hitachi CPU on page 104.

I try to do that without clear the bit 7 on port 6. and with infrared on.


I can receive data in the RCX from the pc via usb bluetooth serial connection
(4800 Baud) as described above
but
transmit data from RCX to Bluetooth module and further to the pc i got only
carbage.
I checked the TX Pin on the RCX with an osziloscope and it looks like the port
is a very sensible to an additional

LOAD. Also on the TX pin there is a carrier of 38Khz (level between 1 Volt means
the voltage is switching something

between 3 till 4 Volt ) .. Interesting..

Example:
If i want to load a program on the RCX and i don not disconnect the TX port to
the RX Port of the Bluetoothmodule, its

allmost impossible do do an download from the Infrared Tower to the RCX.
(I think TX signal breaks down for the resistance or capacative Load). I use the
same curcuit as desribed on the
page http://www.convict.lu/Jeunes/RCXCam/RCXCam_Journal.htm

But how managed  the people from to   http://www.convict.lu/Jeunes/RCXCam/RCXCam_Journal.htm
do it ????

.

more snap from the  http://www.convict.lu/Jeunes/RCXCam/RCXCam_Journal.htm
It is important to add a 100k pull-up resistor to the TX line !!! Otherwise the
TX voltage will drop down to 0.45V it

won't be possible to set up a correct connection. (We do this on the CMUCam2
connector, since a 5V pin exists.)

I have done this hardware .

Maybe I missed something . Has somebody allready has expirience in general about
the RCX hack for RX/TX ?

best regards
Bernhard



Message has 3 Replies:
  Re: Success
 
Hi I have implemented the stuff // and set the port6<7> pin LOW. Now the upper PNP transistor isn't conducting anymore. Now TX and RX works Here are the program #include <lnp.h> #include <conio.h> #include <string.h> #include <lnp-logical.h> (...) (16 years ago, 20-May-08, to lugnet.robotics.rcx.legos)
  Re: RCX Serial Hardware Hack
 
Glad to hear it is working--thank you for the update. If I may ask, I have a few questions-- * So if I understand these posts correctly, 4800 baud now works with the IR connection and not just with the hardware hack? *A couple posts from Dick Swan (...) (16 years ago, 24-May-08, to lugnet.robotics.rcx.legos)
  Re: RCX Serial Hardware Hack
 
(...) The carrier should be quiet in any case, because it disturbs the TX signal. (...) We tried this,but it didn't work. Why, because the transistor will drain some current, if the emitter has positive voltage and the base goes low. If the carrier (...) (16 years ago, 24-May-08, to lugnet.robotics.rcx.legos)

7 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR