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 / 5525
5524  |  5526
Subject: 
Easy communication between HBs
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Wed, 17 Feb 1999 04:16:02 GMT
Original-From: 
Peter Eacmen <eacmen@postoffice.(IHateSpam)worldnet.att.net>
Viewed: 
1150 times
  
After struggling with it for many hours I found an alternative to Randy's
serialio.c serial communication which I couldn't get working.  So I used
the Pa7_9600 Baud Serial output from unknown origin (Fred?)
(http://el.www.media.mit.edu/groups/el/projects/handy-board/software/ser
ial.html).
I cut a standard RJ11 cable and soldered the Rx line(yellow) and the
ground(red) to the ends of a length 4 header.  The header goes into the
transmitting HB and the RJ11 connector goes into the RJ11 jack on the
recieving HB.  On the transmitting HB the header goes to digital input 9
with the yellow end up towards the LCD.
If you have questions post to mailing list I might be able to help.

Here's some sample code:

Transmitting HB:
/* sertest.c: tests pa7_9600() serial output routine */
void main() {
int i;
while (1) {
for (i= 'A'; i<='z'; i++) {
pa7_9600(i);
printf("%c\n", i);
msleep(100L);
}
pa7_9600(13);  /* send carriage return */
pa7_9600(10);  /* send line feed */
}
}




Recieving HB:
void disable_pcode_serial()     /* disable board handshaking with IC   */
                                /* on the host computer, allowing user */
                                /* programs to receive serial data     */
{
    poke(0x3c, 1);
}
int serial_getchar()            /* read a serial character.  Note:  the */
                                /* program hangs until a character is   */
                                /* received!  There is no timeout!      */
{
    while (!(peek(0x102e) & 0x20));     /* wait until a character arrives
*/
    return (peek(0x102f));              /* return it as an int */
}

void main()
{
int x=0;
disable_pcode_serial();

while(1)
{
printf("\n%c",serial_getchar());
}
}



1 Message 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