reading serial port
-
- In need of some credit
- Posts: 6
- Joined: Wed Aug 03, 2005 7:12 pm
reading serial port
Hi,
I have not been able to find an answer, but I am sure it is here some where. I have tried http://www.iftools.com/ctb.en.html and http://www.codeproject.com/system/serial.asp plus I have read every thing else that I could find.
I am running WIN98 using wx-devcpp. I can not even get the above code samples to compile. Found the above links at the wx-devcpp discussion board.
Problem: I have a pic chip sending data to the pc via serial port, this works as I can recieve with hyper-terminal. How do I set up a C++ program to recieve this data ?? I would like to have the data display into a text box so it can be saved to a database.
Thank you.
I have not been able to find an answer, but I am sure it is here some where. I have tried http://www.iftools.com/ctb.en.html and http://www.codeproject.com/system/serial.asp plus I have read every thing else that I could find.
I am running WIN98 using wx-devcpp. I can not even get the above code samples to compile. Found the above links at the wx-devcpp discussion board.
Problem: I have a pic chip sending data to the pc via serial port, this works as I can recieve with hyper-terminal. How do I set up a C++ program to recieve this data ?? I would like to have the data display into a text box so it can be saved to a database.
Thank you.
-
- Filthy Rich wx Solver
- Posts: 210
- Joined: Sat May 07, 2005 8:24 pm
- Location: Eskisehir, TURKEY
- Contact:
According to me, you must use assembler language for in your compiler.
- T U R K E Y ?
- I love this country!
WebSites:
http://mebt.sourceforge.net/
http://wxquran.sourceforge.net/
- I love this country!
WebSites:
http://mebt.sourceforge.net/
http://wxquran.sourceforge.net/
-
- Filthy Rich wx Solver
- Posts: 210
- Joined: Sat May 07, 2005 8:24 pm
- Location: Eskisehir, TURKEY
- Contact:
If you wanna download this assembler projects. You may import dll at this project.
http://www.radasm.com/projects/ComTool050723.zip
http://www.radasm.com/projects/ComTool050723.zip
- T U R K E Y ?
- I love this country!
WebSites:
http://mebt.sourceforge.net/
http://wxquran.sourceforge.net/
- I love this country!
WebSites:
http://mebt.sourceforge.net/
http://wxquran.sourceforge.net/
-
- In need of some credit
- Posts: 6
- Joined: Wed Aug 03, 2005 7:12 pm
hello, MACKRACKIT
I'm too trying make the some thing of you.
I make this simulation in Proteus software
the C code is:
but I don't know how to create the interfacing with the PC. Are you tryning yet?? pls contact me.
I'm too trying make the some thing of you.
I make this simulation in Proteus software
the C code is:
Code: Select all
#include <16f628.H>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_A3, rcv=PIN_A2)
main() {
printf("CONTROL LED WITH PIC\n\r");
do {
printf("\n\r");
printf("Press any key to turn on led...\n\r");
getch();
output_high(pin_b0);
printf("Press any key to turn off led...\n\r");
getch();
output_low(pin_b0);
} while (TRUE);
}
-
- In need of some credit
- Posts: 6
- Joined: Wed Aug 03, 2005 7:12 pm
Well mabey I should not say this here, but I did not have any luck with C. I know it can be done.
I have started using Liberty Basic for this kind of thing, for me it works, some may not like it.
To answer you question, do not try to access the pin on the micro chip directly. Send a string to the chip via serial and have the chip work with the string data.
PC sends 11
chip reads 11 and then moves this into a varible
if VAR=11 then SUB1
PC sends 22
chip reads 22 and then moves this into a varible
if VAR=22 then SUB2
You can then have the chip run with interupts or scan the pin that receives the serial data.
Hope this helps you out.
I have started using Liberty Basic for this kind of thing, for me it works, some may not like it.
To answer you question, do not try to access the pin on the micro chip directly. Send a string to the chip via serial and have the chip work with the string data.
PC sends 11
chip reads 11 and then moves this into a varible
if VAR=11 then SUB1
PC sends 22
chip reads 22 and then moves this into a varible
if VAR=22 then SUB2
You can then have the chip run with interupts or scan the pin that receives the serial data.
Hope this helps you out.
Hello everybody, I am new to wxWidgets and want to use serial port in both Windows and Linux. To be able to build Windows and Linux applications on my Fedora Core 4 box I installed 'native' RPMs with wxGTK-2.6.3 and also compiled the same version of wxWidgets for mingw32 target. The same things was done with wxCTB 0.8.
Now I am trying to write simple application to control modem. The Windows version seems to work as expected so far, but the Linux version drops segmentation fault on ReceiveUntilEOS call Is there some other serial library for wxWidgets? Or should I rebuild wxGTK from sources as I did with wxMSW?
Now I am trying to write simple application to control modem. The Windows version seems to work as expected so far, but the Linux version drops segmentation fault on ReceiveUntilEOS call Is there some other serial library for wxWidgets? Or should I rebuild wxGTK from sources as I did with wxMSW?
the wxCTB library works very well,
i use it for all my serial port communication programs.
despite the name, the wxCTB library itself does not need
wxWidgets to build and use, but it can of course be used
together with wxWidgets.
if you are interested, you can download a Code::Blocks
project file to build libwxctb-0.8.a from sources, which are
published by IF-Tools.
use this link for download
http://tiwag.cb.googlepages.com/home
i use it for all my serial port communication programs.
despite the name, the wxCTB library itself does not need
wxWidgets to build and use, but it can of course be used
together with wxWidgets.
if you are interested, you can download a Code::Blocks
project file to build libwxctb-0.8.a from sources, which are
published by IF-Tools.
use this link for download
http://tiwag.cb.googlepages.com/home
-tiwag
Today I rebuild wxGTK as a static library, and also rebuild my application. Unfortunately it still did segfault on port read. Then I examine my executable with ldd and found that it was linked with wxCTB dynamically. I simply remove libwxctb-0.8.so from /usr/local/lib and rebuild my application again. Now libwxctb is statically linked and works as expected!