![]() |
![]() |
![]() |
|
|
|||||||
| Robotics Chat Specific to discussions about robots and the making of. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Hey people, this is a robotics question as such but im having a bit of a problem with getting a C++ program, running in cygwin (on windows xp), to chat with a navigation controller (running on a PIC16F877A).
How can i access and read from/write to the serial port (COM1) inside cygwin?!?! I can use the standard terminal program in windows and it (the PIC) recieves and echos back any characters that i send. if this is WAAAAY off topic for the board then i apologise :s |
|
|
|
|
|
|
(permalink) |
|
Are you refering to writting an application that talks to the serial port that is compiled using gcc?
A simple goolgle search will yeild windows code to talk to the serial ports. I have used serial ports in MFC applications and under linux but not using cygwin under windows.
__________________
Dude, no way!!!! |
|
|
|
|
|
|
(permalink) |
|
Yer i am compiling using g++ (so yes gcc). I find LOADS of stuff concerning visual C++ and things but i am coding in just straight C++ at the command line, not a windows app etc...
|
|
|
|
|
|
|
(permalink) |
|
Are you stuck to C++? I've used a free compiler called LCC-Win32 which allows windows program, it's ANSI C though.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a straight answer, har har." |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Given that Cygwin imitates a unix environment, I'd think that UNIX code would do the job. I haven't tried it with Cygwin, but I think you need to execute the standard termios (and maybe ioctl) commands to the "file" in /dev/ that points to your serial port. The commands are confusing but I've managed to get code to work based on sample C code that I've found, I just have not tried it under Windows yet.
Another possibility is Python. I don't know if Cygwin includes Python, but there is dirt-simple cross-platform code (it's less than 10 lines of code) to make python scripts to perform serial I/O. Then you can possibly call those scripts within C++. Last edited by JeffDM; 9th March 2007 at 01:43 PM. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| PIC16F877A interfacing with Serial Port | jasbertfalutine | Micro Controllers | 10 | 18th June 2006 07:25 AM |
| serial port cud u extend it?????? | jam_mafia | Electronic Projects Design/Ideas/Reviews | 5 | 15th February 2006 06:51 AM |
| Serial to Parallel | mstechca | Electronic Projects Design/Ideas/Reviews | 6 | 30th March 2005 04:40 AM |
| pic16f877 serial recieve acting screwy | masconejos | Micro Controllers | 6 | 9th April 2004 10:08 AM |
| Can a Basic Stamp support 2 serial ports? | Scruit | Electronic Projects Design/Ideas/Reviews | 13 | 15th August 2003 02:07 PM |