![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| hi to all, I have programmed PIC in asynchronous mode and transmitting data continusly with 9600 baub rate , and on pc side i have written program in visual basic. using mscomm component , and watching received data in one message box. but i'm not receiving proper data, can anyone tell me what might be the problem . if u give me any sample program for both PIC and PC in vb or either , i will be very greatful.
__________________ MOTGI ANUPAMA. | |
| |
| | (permalink) | |
| Quote:
Try using Hyperterminal to see what that shows - this should show you if the probelm is at the PIC end or your VB program. | ||
| |
| | (permalink) |
| :idea: If the data is not "proper" it may be that you have set up the UART incorectly for the expected speed, recheck this....... As Nigel sujjested, try looking at the data in hyperterminal, I prefer to use software called QModem, it's old now and you have to run the installer in win95 compatability mode...... but it has a "debug hex" feature, this allows you to see the numbers you are actually getting. Another brilliant bit of software to help in these problems is portmon.... http://www.sysinternals.com/ntw2k/fr.../portmon.shtml It's free, start it up before your VB and you can see all traffic etc from the PC<->PIC (also the windows calls etc from VB) it's brilliant! Hope this helps!
__________________ Regards MATT! | |
| |
| | (permalink) |
| are you receiving complete rubbish or just missing some bytes? I couldn't get a pic to VB thing to work properly some time ago (missing bytes) and it turned out to be the VB software was to blame (to slow?) opened realterm and all worked well... Lost trust in VB this way. Anyhow, if you want a good and free program to monitor the serial port you should get realterm, has 1001 options . http://realterm.sourceforge.net/ if you're just receiving rubbish then check: -baudrate , databits, start and stop bits... on both sides -if you use the hardware usart you need a level shifter that inverts the signal | |
| |
| | (permalink) | ||
| Quote:
| |||
| |
| | (permalink) | |
| Quote:
But I don't use VB, perhaps that is a VB characteristic?. | ||
| |
| | (permalink) |
| No, it's windows itself that doesn't allow nonbinary transactions Here is a MSDN view of a DCB structure used to set/get serial port settings http://msdn.microsoft.com/library/de...se/dcb_str.asp take a look at the explanation for the member fBinairy... | |
| |
| | (permalink) | |
| Quote:
__________________ MOTGI ANUPAMA. | ||
| |
| | (permalink) |
| I have happily transmitted both ASCII and binary data to the PC from the PIC. Although I have not used VB, I have used Borland C++ with the Async Pro without a problem. I also have used Microsoft C# and have had problems with loosing data. I also found the port component slower in C#. | |
| |