Shop OBEX P1 Docs P2 Docs Learn Events
help.... — Parallax Forums

help....

ArchiverArchiver Posts: 46,084
edited 2002-01-18 13:05 in General Discussion
Hi there!

Long time no post.

Anyways, I was wondering if anyone can help me out.

I have a BS2SX micro controller, and it is connected to a
transceiver. At a computer, I have another transceiver. The
computer is using C code to display the characters that is
transmitted from the BS2SX. The computer can also send out data to
the BS2SX, and it will receive and print the data to screen.

My problem is, the further I separate the two transceivers, the more
bit error I get, and the more funny characters I receive. What would
you suggest to do error checking? I'm assuming I'd have to code the
error checking, but, programming is one of my weaknesses.

Is there a way to do parity checking? One thing I don't understand
is that if there is an error, how do i request for it to be resent?
or does it do it automatically?

Please also note that at the computer side, the transceiver is
connected to the serial port of the computer (ie, there is no BS2SX
at the computer terminal).

Thanks!

Debu

ps- here is the C code i'm using at the computer side
#include <dos.h>
#include <stdio.h>
#include <conio.h>

#define PORT1 0x3F8
#define PORT2 0x2F8

/* Defines Serial Ports Base Address */
/* COM1 0x3F8 */
/* COM2 0x2F8 */
/* COM3 0x3E8 */
/* COM4 0x2E8 */

void main(void)
{
int c;
int ch_in = 0;
int ch_out = 0;


outportb(PORT1 + 1 , 0); /* Turn off interrupts - Port1 */

/* PORT 1 - Communication Settings */

outportb(PORT1 + 3 , 0x80); /* SET DLAB ON */
outportb(PORT1 + 0 , 0x30); /* Set Baud rate - Divisor Latch Low
Byte */
/* Default 0x03 = 38,400 BPS */
/* 0x01 = 115,200 BPS */
/* 0x02 = 57,600 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 */


printf("\nPress ESC to quit \n");

do { c = inportb(PORT1 + 5); /* Check to see if char has
been */
/*
received. */
if (c & 1) {
ch_in = inportb(PORT1); /* If so, then get Char*/


if (ch_in != ch_out) {
printf("PORT1-R = %c \n",ch_in); /* Print Char to
Screen*/
}


}

if (kbhit()) {
ch_out = getch(); /* If key pressed, get Char */
printf("PORT1-S = %c\n",0x55);
outportb(PORT1, ch_out); /* Send Char to Serial Port */
}

} while (ch_out !=27); /* Quit when ESC (ASC 27) is pressed */

}

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-01-18 06:01
    You have a RF path loss between the transceivers which is a function of
    distance. Review the application notes that talk about max distance allowed
    between the Transceiver units.
    Steve
    Original Message
    From: "debu_sen_22" <debu_sen_22@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, January 17, 2002 7:39 PM
    Subject: [noparse][[/noparse]basicstamps] help....


    > Hi there!
    >
    > Long time no post.
    >
    > Anyways, I was wondering if anyone can help me out.
    >
    > I have a BS2SX micro controller, and it is connected to a
    > transceiver. At a computer, I have another transceiver. The
    > computer is using C code to display the characters that is
    > transmitted from the BS2SX. The computer can also send out data to
    > the BS2SX, and it will receive and print the data to screen.
    >
    > My problem is, the further I separate the two transceivers, the more
    > bit error I get, and the more funny characters I receive. What would
    > you suggest to do error checking? I'm assuming I'd have to code the
    > error checking, but, programming is one of my weaknesses.
    >
    > Is there a way to do parity checking? One thing I don't understand
    > is that if there is an error, how do i request for it to be resent?
    > or does it do it automatically?
    >
    > Please also note that at the computer side, the transceiver is
    > connected to the serial port of the computer (ie, there is no BS2SX
    > at the computer terminal).
    >
    > Thanks!
    >
    > Debu
    >
    > ps- here is the C code i'm using at the computer side
    > #include <dos.h>
    > #include <stdio.h>
    > #include <conio.h>
    >
    > #define PORT1 0x3F8
    > #define PORT2 0x2F8
    >
    > /* Defines Serial Ports Base Address */
    > /* COM1 0x3F8 */
    > /* COM2 0x2F8 */
    > /* COM3 0x3E8 */
    > /* COM4 0x2E8 */
    >
    > void main(void)
    > {
    > int c;
    > int ch_in = 0;
    > int ch_out = 0;
    >
    >
    > outportb(PORT1 + 1 , 0); /* Turn off interrupts - Port1 */
    >
    > /* PORT 1 - Communication Settings */
    >
    > outportb(PORT1 + 3 , 0x80); /* SET DLAB ON */
    > outportb(PORT1 + 0 , 0x30); /* Set Baud rate - Divisor Latch Low
    > Byte */
    > /* Default 0x03 = 38,400 BPS */
    > /* 0x01 = 115,200 BPS */
    > /* 0x02 = 57,600 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 */
    >
    >
    > printf("\nPress ESC to quit \n");
    >
    > do { c = inportb(PORT1 + 5); /* Check to see if char has
    > been */
    > /*
    > received. */
    > if (c & 1) {
    > ch_in = inportb(PORT1); /* If so, then get Char*/
    >
    >
    > if (ch_in != ch_out) {
    > printf("PORT1-R = %c \n",ch_in); /* Print Char to
    > Screen*/
    > }
    >
    >
    > }
    >
    > if (kbhit()) {
    > ch_out = getch(); /* If key pressed, get Char */
    > printf("PORT1-S = %c\n",0x55);
    > outportb(PORT1, ch_out); /* Send Char to Serial Port */
    > }
    >
    > } while (ch_out !=27); /* Quit when ESC (ASC 27) is pressed */
    >
    > }
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-18 13:05
    Also,

    The stamp produces a ton of energy in the RF spectrum, some of which is in
    the wireless frequency bands. Some of this might be overloading the receiver
    side, truncating the sometimes optimistic distance specification of the
    units.

    It will take too long to explain all the methods used to shield your RX and
    antenna, but the simplest was is to shield the stamp with a tin box
    connecting the box to ground. For further improvement connect a 10 pico
    farad ceramic capcitor to ground fom each wire that comes out of the tin
    box.

    Regards,

    Tony Wells

    The Inventor of Luminous Custard

    Original Message
    From: "Stephen H Chapman" <chapman@t...>
    To: <basicstamps@yahoogroups.com>
    Sent: Friday, January 18, 2002 6:01 AM
    Subject: Re: [noparse][[/noparse]basicstamps] help....


    > You have a RF path loss between the transceivers which is a function of
    > distance. Review the application notes that talk about max distance
    allowed
    > between the Transceiver units.
    > Steve
    >
    Original Message
    > From: "debu_sen_22" <debu_sen_22@y...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, January 17, 2002 7:39 PM
    > Subject: [noparse][[/noparse]basicstamps] help....
    >
    >
    > > Hi there!
    > >
    > > Long time no post.
    > >
    > > Anyways, I was wondering if anyone can help me out.
    > >
    > > I have a BS2SX micro controller, and it is connected to a
    > > transceiver. At a computer, I have another transceiver. The
    > > computer is using C code to display the characters that is
    > > transmitted from the BS2SX. The computer can also send out data to
    > > the BS2SX, and it will receive and print the data to screen.
    > >
    > > My problem is, the further I separate the two transceivers, the more
    > > bit error I get, and the more funny characters I receive. What would
    > > you suggest to do error checking? I'm assuming I'd have to code the
    > > error checking, but, programming is one of my weaknesses.
    > >
    > > Is there a way to do parity checking? One thing I don't understand
    > > is that if there is an error, how do i request for it to be resent?
    > > or does it do it automatically?
    > >
    > > Please also note that at the computer side, the transceiver is
    > > connected to the serial port of the computer (ie, there is no BS2SX
    > > at the computer terminal).
    > >
    > > Thanks!
    > >
    > > Debu
    > >
    > > ps- here is the C code i'm using at the computer side
    > > #include <dos.h>
    > > #include <stdio.h>
    > > #include <conio.h>
    > >
    > > #define PORT1 0x3F8
    > > #define PORT2 0x2F8
    > >
    > > /* Defines Serial Ports Base Address */
    > > /* COM1 0x3F8 */
    > > /* COM2 0x2F8 */
    > > /* COM3 0x3E8 */
    > > /* COM4 0x2E8 */
    > >
    > > void main(void)
    > > {
    > > int c;
    > > int ch_in = 0;
    > > int ch_out = 0;
    > >
    > >
    > > outportb(PORT1 + 1 , 0); /* Turn off interrupts - Port1 */
    > >
    > > /* PORT 1 - Communication Settings */
    > >
    > > outportb(PORT1 + 3 , 0x80); /* SET DLAB ON */
    > > outportb(PORT1 + 0 , 0x30); /* Set Baud rate - Divisor Latch Low
    > > Byte */
    > > /* Default 0x03 = 38,400 BPS */
    > > /* 0x01 = 115,200 BPS */
    > > /* 0x02 = 57,600 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 */
    > >
    > >
    > > printf("\nPress ESC to quit \n");
    > >
    > > do { c = inportb(PORT1 + 5); /* Check to see if char has
    > > been */
    > > /*
    > > received. */
    > > if (c & 1) {
    > > ch_in = inportb(PORT1); /* If so, then get Char*/
    > >
    > >
    > > if (ch_in != ch_out) {
    > > printf("PORT1-R = %c \n",ch_in); /* Print Char to
    > > Screen*/
    > > }
    > >
    > >
    > > }
    > >
    > > if (kbhit()) {
    > > ch_out = getch(); /* If key pressed, get Char */
    > > printf("PORT1-S = %c\n",0x55);
    > > outportb(PORT1, ch_out); /* Send Char to Serial Port */
    > > }
    > >
    > > } while (ch_out !=27); /* Quit when ESC (ASC 27) is pressed */
    > >
    > > }
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject
    and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
Sign In or Register to comment.