Click here to Skip to main content
15,346,219 members
Home / Discussions / C#
   

C#

 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Luc Pattyn17-Jan-22 4:16
sitebuilderLuc Pattyn17-Jan-22 4:16 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Sanjay Siwach17-Jan-22 4:46
MemberSanjay Siwach17-Jan-22 4:46 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Luc Pattyn17-Jan-22 5:02
sitebuilderLuc Pattyn17-Jan-22 5:02 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Sanjay Siwach17-Jan-22 5:15
MemberSanjay Siwach17-Jan-22 5:15 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Sanjay Siwach17-Jan-22 5:23
MemberSanjay Siwach17-Jan-22 5:23 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Sanjay Siwach17-Jan-22 9:46
MemberSanjay Siwach17-Jan-22 9:46 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Luc Pattyn17-Jan-22 11:40
sitebuilderLuc Pattyn17-Jan-22 11:40 
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Member 1549617517-Jan-22 21:51
MemberMember 1549617517-Jan-22 21:51 
Dear Sir,

I highly appreciate the work you did for me.
I am not expert as you are but I would like to put some point with you may agree or not.

1. There should not be any suspicion of this document as I put same material as mention in document.
2. You are talking about specification and no text, so, I think command all says that Read version request(send command- 25 52 02 01 DE) - this command we need to send and response command from microcontroller(25 52 0C 01 UHD-4k.02.10.09 C2).

This command just only to see version in the system.

3. I mentioned before that there is 6 keys on the keypad. Key_WB is one of the key. There is command given for the this key:-

Send command to microcontroller- %W 0x03 0x02 0xF3 LRC
Response command from microntroller to PC - % W 0x02 ACK LRC (this command should with ACK byte)

For LRC, LRC value is calculated only for this command , for other keys, I think I have to calculate to put in command.

I did not get the point that you are calculating the response command(%R 0x0C 0x01 UHD-4K 02.10.09 0xC2) instead of input command(0x25 0x52 0x02 0x01 0xDE). The microcontroller is predefined with these commands and when we will send these commands to microcontroller, so, microcontroller should respond as protocol.

Now my question here is that, We need response from microcontroller with ACK byte and for this purpose, how we can write programm in visual studio with c# to send command with GUI and get reposne from microcontroller.

I am sharing again important information to check.

Protocol:-
Request „Read“ :
« %R NUM CMD LRC »

Ex- 0x25 0x52 0x02 0x01 0xDE

Response „Read“:
« %R NUM CMD DATA LRC »

Ex- %R 0x0C 0x01 UHD-4K 02.10.09 0xC2
__________________________________________________________________________
Request „Write“ (Send Command to microcontroller)
« %W NUM CMD Data LRC »

Ex- %W 0x03 0x02 0xF3 LRC (Send Command to microcontroller)

Response „Write“:

« %W NUM STAT LRC »

Ex- % W 0x02 ACK LRC (Response command from microcontroller)

% = Start of message
R/W = Read/Write
CMD = Command
NUM = length of message (all bytes excluding „% R/W NUM“)
DATA = real data

LRC = XOR complete message
STAT = ACK (0x06) = OK
NAK (0x15) = not OK
BUSY (0x07) = in process

In case of negative answer (NACK) the request must be repeated until a positive answer
(ACK) has been received. The delay time for a new request has a minimum of 100ms.
In case of answer (BUSY) the sender has to wait until the answer (ACK) has been
received.
In every case; each request must be answered with an response. The host has to wait on
an response.

I think I have given enough information to understand the logic. I just need advise to write a program for serial communication with c# and get response from microcontroller with ACK byte.

Regards
GeneralRe: Serial communication between LPC2132 microcontroller and serial interface PC through RS 232 and RJ45 Pin
Luc Pattyn18-Jan-22 2:29
sitebuilderLuc Pattyn18-Jan-22 2:29 
QuestionEasy way programmatically select step by step button. Pin
Member 154938239-Jan-22 2:20
MemberMember 154938239-Jan-22 2:20 
AnswerRe: Easy way programmatically select step by step button. Pin
OriginalGriff9-Jan-22 2:24
mveOriginalGriff9-Jan-22 2:24 
GeneralRe: Easy way programmatically select step by step button. Pin
Member 154938239-Jan-22 2:37
MemberMember 154938239-Jan-22 2:37 
GeneralRe: Easy way programmatically select step by step button. Pin
OriginalGriff9-Jan-22 3:09
mveOriginalGriff9-Jan-22 3:09 
AnswerRe: Easy way programmatically select step by step button. Pin
#realJSOP9-Jan-22 3:15
mva#realJSOP9-Jan-22 3:15 
AnswerRe: Easy way programmatically select step by step button. Pin
Gerry Schmitz9-Jan-22 7:17
mveGerry Schmitz9-Jan-22 7:17 
GeneralRe: Easy way programmatically select step by step button. Pin
OriginalGriff9-Jan-22 9:38
mveOriginalGriff9-Jan-22 9:38 
GeneralRe: Easy way programmatically select step by step button. Pin
Gerry Schmitz9-Jan-22 21:11
mveGerry Schmitz9-Jan-22 21:11 
GeneralRe: Easy way programmatically select step by step button. Pin
OriginalGriff9-Jan-22 21:18
mveOriginalGriff9-Jan-22 21:18 
JokeRe: Easy way programmatically select step by step button. Pin
Richard Deeming9-Jan-22 21:30
mveRichard Deeming9-Jan-22 21:30 
GeneralRe: Easy way programmatically select step by step button. Pin
OriginalGriff9-Jan-22 21:58
mveOriginalGriff9-Jan-22 21:58 
Questionbind a gridview and a listbox to a database Pin
steven_noppe5-Jan-22 2:03
Membersteven_noppe5-Jan-22 2:03 
AnswerRe: bind a gridview and a listbox to a database Pin
Gerry Schmitz5-Jan-22 5:26
mveGerry Schmitz5-Jan-22 5:26 
AnswerRe: bind a gridview and a listbox to a database Pin
RobertSF7-Jan-22 10:47
professionalRobertSF7-Jan-22 10:47 
GeneralRe: bind a gridview and a listbox to a database Pin
steven_noppe11-Jan-22 22:31
Membersteven_noppe11-Jan-22 22:31 
GeneralRe: bind a gridview and a listbox to a database Pin
RobertSF12-Jan-22 12:37
professionalRobertSF12-Jan-22 12:37 

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.