Click here to Skip to main content
15,897,704 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem in Reading from serial port Pin
Eddy Vluggen9-Dec-08 1:21
professionalEddy Vluggen9-Dec-08 1:21 
GeneralRe: Problem in Reading from serial port Pin
TJS4u9-Dec-08 1:34
TJS4u9-Dec-08 1:34 
GeneralRe: Problem in Reading from serial port Pin
Eddy Vluggen9-Dec-08 1:47
professionalEddy Vluggen9-Dec-08 1:47 
GeneralRe: Problem in Reading from serial port Pin
TJS4u9-Dec-08 1:56
TJS4u9-Dec-08 1:56 
GeneralRe: Problem in Reading from serial port Pin
Eddy Vluggen9-Dec-08 3:11
professionalEddy Vluggen9-Dec-08 3:11 
GeneralRe: Problem in Reading from serial port Pin
TJS4u9-Dec-08 3:19
TJS4u9-Dec-08 3:19 
GeneralRe: Problem in Reading from serial port Pin
Eddy Vluggen9-Dec-08 3:25
professionalEddy Vluggen9-Dec-08 3:25 
GeneralRe: Problem in Reading from serial port Pin
Luc Pattyn9-Dec-08 1:59
sitebuilderLuc Pattyn9-Dec-08 1:59 
Hi,

It is my impression this project is way beyond your current reach. Nevertheless here are some facts:

1.
transmit and receive channels are (almost) completely independent: there is a wire in each direction, there is separate electronics, separate data buffers, and different methods to call.
The only link exists inside the serial driver when software dataflow is used (XON/XOFF).
2.
whatever gets sent through a serial port is gone in a couple of micro- or milliseconds, you can't read it back; you can (if things go well) find the data at the target hardware after that delay.

Some suggestions:
1.
if all is new to you (C#, serial ports, microcontroller) you have zero probability to get it working by just setting it all up and hope for the best. You MUST go step by step, debug each step completely before taking the next step.
2.
The first step should be one of these (in increasing level of difficulty):
2a. use two PC's (I'll call them master and target) connect them through a serial cable WITH A NULL MODEM (which switches transmit and receive lines); run a terminal emulator (HyperTerminal, whatever) on the target PC, so you make it emulate your microcontroller by reading the emulator display and typing keys when appropriate. And run your own code on the master PC. Now you can first debug transmission: your program writing, the emulator showing what comes in; then you can tackle the receive side (with buffers, events, etc).
2b. you could try the same on a single PC (using two serial ports, connected with again a NULL MODEM); it is much less comfortable though.
2c. you don't even need real serial ports and a null modem cable, you can use a VIRTUAL NULL MODEM
(Google for com0com).
3. If all this works, you could try to use the microcontroller. If that one needs a program download, you'd better won't need its serial port for that, since it has not been debugged yet,
so it will not work initially.


Good luck.

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


Questioncreate slidable form [modified] Pin
Member 44132839-Dec-08 0:47
Member 44132839-Dec-08 0:47 
AnswerRe: create slidable form Pin
Simon P Stevens9-Dec-08 0:53
Simon P Stevens9-Dec-08 0:53 
AnswerRe: create slidable form Pin
Brij9-Dec-08 0:57
mentorBrij9-Dec-08 0:57 
QuestionHow to Read and Write to Serial Port using C# Pin
TJS4u9-Dec-08 0:46
TJS4u9-Dec-08 0:46 
AnswerRe: How to Read and Write to Serial Port using C# Pin
Simon P Stevens9-Dec-08 0:51
Simon P Stevens9-Dec-08 0:51 
GeneralRe: How to Read and Write to Serial Port using C# Pin
TJS4u9-Dec-08 0:56
TJS4u9-Dec-08 0:56 
GeneralRe: How to Read and Write to Serial Port using C# Pin
leppie9-Dec-08 1:08
leppie9-Dec-08 1:08 
GeneralRe: How to Read and Write to Serial Port using C# Pin
TJS4u9-Dec-08 1:20
TJS4u9-Dec-08 1:20 
GeneralRe: How to Read and Write to Serial Port using C# Pin
Simon P Stevens9-Dec-08 1:10
Simon P Stevens9-Dec-08 1:10 
AnswerRe: How to Read and Write to Serial Port using C# Pin
Giorgi Dalakishvili9-Dec-08 0:52
mentorGiorgi Dalakishvili9-Dec-08 0:52 
GeneralRe: How to Read and Write to Serial Port using C# Pin
TJS4u9-Dec-08 0:58
TJS4u9-Dec-08 0:58 
AnswerRe: How to Read and Write to Serial Port using C# Pin
Himadri Majumdar9-Dec-08 5:25
Himadri Majumdar9-Dec-08 5:25 
AnswerRe: How to Read and Write to Serial Port using C# Pin
User 66589-Dec-08 0:54
User 66589-Dec-08 0:54 
Questionhow to create image manually Pin
Ronenb9-Dec-08 0:26
Ronenb9-Dec-08 0:26 
AnswerRe: how to create image manually Pin
benjymous9-Dec-08 0:39
benjymous9-Dec-08 0:39 
GeneralRe: how to create image manually Pin
Ronenb9-Dec-08 2:22
Ronenb9-Dec-08 2:22 
GeneralRe: how to create image manually Pin
Luc Pattyn9-Dec-08 0:39
sitebuilderLuc Pattyn9-Dec-08 0:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.