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 / 4024
4023  |  4025
Subject: 
Re: Problem to send long messages from RCX to PC via com Hack
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 29 Jun 2008 06:41:37 GMT
Viewed: 
23972 times
  
In lugnet.robotics.rcx.legos, Matthew Sheets wrote:
I don't know if this is would be of any help, as it uses a different
approach, but I thought I'd pass it along anyway....

Bi-directional Bluetooth to IR translator -
http://www.robotics.sk/maine.php?page=/projects/rcxbt/
  (PDF format: http://www.robotics.sk/projects/rcxbt/rcxbt.pdf )

While this solution doesn't allow both the serial and IR to be active like
the method that has been discussed, the Bluetooth adapter communication can
be throttled back to "2400-odd-1" (see PDF page 7).  Might this
communication configuration capability alleviate any of the present issues,
or has the communication speed limitation related to the other Bluetooth
adapter been overcome?


Thanks,
Matthew

Dear Matthew
I have found the problem. It was in kernel\lnp-locical.c
-> cheking the echo was the problem
solution: echo OFF
it is a rough solution, but it works

changes
1) rx_handler(void)
...
    // echos of own bytes -> collision detection
    //
    // S_RDR //! serial receive data register
    // !< tx_verify: ptr to next byte to verify
    if(S_RDR!=*tx_verify) {

    // //powo change we have no collision OK rs232 BT bf_flag=1;
    if (bt_flag == 0) {  // pow 0 infrared return with collision 1=comport bt
      txend_handler(); // shutdown transmit and irqs, clear status flags
      //tx_state=TX_COLL; //(-1) /!< not transmitting, last xmit was collision
      tx_state=TX_COLL;
      // if (bt_flag == 1) tx_state = TX_MIST;  // pow  error TX_COLL   (-1)
      }

and
-> echo OFF in function

2)
void reset_powo(void){
txend_handler();
tx_state=TX_RESET;  //TX_RESET  (-5)
}


static void rxerror_handler(void) {
..
  time_t new_tx;
  if(tx_state<TX_ACTIVE) {
    //lnp_integrity_reset();  // pow geändert kein txend_handler();
    reset_powo(); // //powo change we have no collision OK

    new_tx = get_system_up_time()+lnp_byte_safe;
    if (new_tx > allow_tx) allow_tx = new_tx;
  } else {
    txend_handler();  //
    //tx_state=TX_COLL; //(-1)
    tx_state=TX_ERROR; // (-2)  // 1) TX_COLL_LNP_RESET  (-4)  //!<
lnp_integrity_reset
  }

and in  include\lnp\sys\lnp-logical.h

////#define POWO B2400
extern unsigned char test_bt_flag (void);
extern unsigned char bt_flag;  // pow if 0 then infrared  1 bt oder com
extern unsigned char empfangs_byte ;


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;


the brick  program

... snip
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    4,5 ms
   unsigned short lnp_byte_safe_temp =   (4*lnp_byte_time);    //!< delay before transmitting a byte  12
   unsigned short lnp_wait_txok_temp =   (2*lnp_byte_timeout); //!< delay after good transmit         9
   unsigned short lnp_wait_coll_temp =   (4*lnp_byte_timeout); //!< delay after collision             18

   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;
}

...

void infrared_on()    {
     //! enable IR carrier frequency.
     //extern inline void carrier_init(void) {  }
     T1_CR  =0x9;
     T1_CSR =0x13;
     T1_CORA=0x1a;
}


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

int main ( int argc, char **argv ) {
....
   lnp_logical_shutdown();      sleep(1);
   baud4800();
   lnp_logical_init();
   infrared_off();
   bt_flag=1;   //NO  echo  tx ok
   ..

  best regards Bernhard



Message is in Reply To:
  Re: Problem to send long messages from RCX to PC via com Hack
 
I don't know if this is would be of any help, as it uses a different approach, but I thought I'd pass it along anyway.... Bi-directional Bluetooth to IR translator - (URL) (PDF format: (URL) ) While this solution doesn't allow both the serial and IR (...) (16 years ago, 28-Jun-08, to lugnet.robotics.rcx.legos)

3 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