Freeze the communication after 30 minutes


+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Pedro Pinto's Avatar
    Pedro Pinto Guest

    Default Freeze the communication after 30 minutes

    Hello

    In my apliacation, I will make a scan to several pcb boards through serial communication. For test purpose, i have only one pcb connect to the PC trough a USBtoRS232 converter, later, it must work as a wireless network. On the boards scan procedur, the PC application send data to ask the boards one after another, if they have new data to store on the PC aplicattion. Everytime the asked PCBboard have no data, after a timeout on the PC applications, the programm on the PC ask the next pcb board, and so on...It works about 15...30 Minutes perfectly, after that period, in one of the scan phases, the pcb board that have new data, try to send and freeze the communication, the program on the PC doesn't receive the data anymore. I have to unplug the USBtoRS232 converter and plug again and restart the PC application. Have somebody an idea how to solve this problem. Due this application have to work continually and autonomous, nobody won't exist to unplug and plug the USBtoRS232 again restart the PC application.

    Thanks
    Best regards
    Pedro

    ''Here part of code that freeze the communication after 30 minutes with 18F4520

    Code:
    engine = 2
    
    scanboards:    
    SERIN2 rx_,bmode,500,final,[wait ("P"),dec2 function,dec3 board, dec3 dumy] ''receive the comando what to do
    '
    '     *******************  PC ask the if have new data, the flag  reg_complet have this information *******************
    if (function = 30) and (engine = board) and (reg_complet = 1) then 
    
    ''read the data from the 18F4520 eeprom
      read 10,tmp0
      read 11,tmp1
      read 12,tmp2
      read 13,tmp3
      read 14,tmp4
      read 15,tmp5
      read 16,tmp6
      read 17,tmp7
      read 18,tmp8
      read 19,tmp9
      read 20,tmp10
      read 21,tmp11
      read 22,tmp12
      read 23,tmp13
      read 24,tmp14
      read 25,tmp15
      read 26,tecnico1
      read 27,tecnico0               
    '               
    ''send the new data to the PC
    serout2 tx_,bmode,["dumi",";",hex2 tmp0,";",hex2 tmp1,";",hex2 tmp2,_
                                 ";",hex2 tmp3,";",hex2 tmp4,";",hex2 tmp5,_
                                 ";",hex2 tmp6,";",hex2 tmp7,";",hex2 tmp8,_
                                 ";",hex2 tmp9,";",hex2 tmp10,";",hex2 tmp11,_
                                 ";",dec3 tmp12,";",dec3 tmp13,";",dec3 tmp14,_
                                 ";",hex2 tmp15,";",hex4 tecnico,13,10]
    serout2 tx_,bmode,["y",13,10] ''end of data
    '
    SERIN2 rx_,bmode,5000,final,[wait ("OK"),dec3 board] ''wait during 5 seg a confirmation from the PC application that have received the new data
     if board = engine then
     reg_completo = 0   ''data received, clear the flag that have no more new data to send
     write 4, reg_complet ''save the flag for posterior test
     endif                
    endif
    final:
    return

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    899

    Default

    Pedro

    Are you sure it's not a USB-RS232 converter problem? I've seen this issue before. If possible, try your program with a plain serial port available on some old PC. Most likely it is a converter problem.

    Jerson

  3. #3
    Join Date
    Oct 2004
    Posts
    448

    Default

    Pedro, as Jerson pointed out its most likely the USB-to-serial converter.

    Also, make sure your PC doesnt go into screen-saver mode; that might cause hassles with your USB-to-serial.

    Anand

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,817

    Default

    Quote Originally Posted by ardhuru View Post
    Pedro, as Jerson pointed out its most likely the USB-to-serial converter.

    Also, make sure your PC doesnt go into screen-saver mode; that might cause hassles with your USB-to-serial.

    Anand
    . . . Screen saver and hard drive suspend mode, you can turn all that stuff off . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Pedro Pinto's Avatar
    Pedro Pinto Guest

    Default

    Hello

    I have tested on a old PC, direct to RS232 input, and it works without freeze
    I will try make tests with another USBtoRS232 converter. The applications must work on a Notebook and today they have not RS232 input anymore.
    My USBtoRS232 converter have a Prolific chip and the drives for that are uptodate.

    Regards
    Pedro

  6. #6
    Join Date
    Oct 2004
    Posts
    448

    Default

    If things dont work, here are 2 options;

    a) migrate the project to a USB chip and use a virtual com port on the notebook

    b) buy a PCMCIA based serial port card; these are true 16551 UARTs, and are almost as good as having serial ports built-in into the notebook.

    Regards,

    Anand

Similar Threads

  1. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 09:42
  2. after five months the clock is early 30 minutes
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd April 2009, 19:23
  3. 10,20,30,40 minutes
    By helena in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st March 2007, 13:04
  4. Replies: 2
    Last Post: - 10th June 2005, 03:34
  5. Replies: 8
    Last Post: - 11th November 2004, 21:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts