To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 7714
7713  |  7715
Subject: 
Output to file option for IC?
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 6 Apr 2000 02:11:55 GMT
Viewed: 
2719 times
  
It would be cool if IC can output results to a file.  well, since it can't
does anyone have code available for borland c++ which will receive data over
the serial port?  I found some code from earlier posts, but can't seem to find
one that works.

I think this came the closest.  I never get "98" back and connection between
IC and the board was lost every time I tried to read the data.

ANY HELP IS APPRECITED... THANKS!

Here's the code:
--------------------------------------------------------------
HB side:
void iotest(void)
{
  disable_pcode_serial();
  serial_putchar(98);
  reenable_pcode_serial();
}

--------------------------------------------------------------
Borland C++ code:

#include <stdio.h>
#include <dos.h>
#include <string.h>
#include <ctype.h>

#define PORT1 0x3F8 /* com1 */


void initialize_comport(void)
{
  outportb(PORT1+1,0); /* turn off interrupts */
  outportb(PORT1+3,0x80); /* set DLAB on */
  outportb(PORT1+0,0x0C); /* set baud rate - divisor latch low byte */
                                                /* 0x01 = 115,200 BPS */
                                                /* 0x02 = 56,700 BPS */
                                                /* 0x03 = 38,400 BPS */
                                                /* 0x06 = 19,200 BPS */
                                                /* 0x0C = 9,600 BPS */
                                                /* 0x18 = 4,800 BPS */
                                                /* 0x30 = 2,400 BPS */
  outportb(PORT1+1,0x00); /* set baud rate - divisor latch high byte */
  outportb(PORT1+3,0x03); /* 8 bits, no parity, 1 stop bit */
  outportb(PORT1+2,0xC7); /* FIFO control register */
  outportb(PORT1+4,0x0B); /* turn on DTR, RTS, and OUT2 */
}

void main()
{
  initialize_comport();
  printf("%d",inportb( PORT1 ));
}



Message has 2 Replies:
  Re: Output to file option for IC?
 
We have a system that was designed to let you run IC-like code on a host as if it were running on the HB. We use the HB as an extension to a larger mobile robot (the HB turns on lights, motors, etc. Our robot served candy via voice command at last (...) (24 years ago, 6-Apr-00, to lugnet.robotics.handyboard)
  Re: Output to file option for IC?
 
(...) Here's a stupid idea, but might be the simplest: Run a dumb terminal program. I keep a very old version of Telix for DOS around for this purpose. Most of the dumb terminal programs have some option or other for logging or capturing to a file. (...) (24 years ago, 6-Apr-00, to lugnet.robotics.handyboard)

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