(you are viewing a thread; or go back to
list of threads)
Receive data in the PIC from HMI (by Carlos Torrez)
I tested with the HMI Micset digital and analog data, but not how to convert analog data (ASCII) to decimal, the idea is to read a temperature sensor (LM35)
On the other hand nose as receive data from the HMI to the PIC, in the example of shipping using the Format String Over UART but is just does not get sent.
Thanks for your help, if someone would help me enough examples
David R (by Carlos Torrez)
You can help me with this?
Thanks in advance
David R (by Carlos Torrez)
You can help me with this?
Thanks in advance
(no subject) (by David R)
Hi yes I can help I will will build some code and post,
I don't understand your problem with the lm35 can you post the .ld file that you are using to send to Micset.
(no subject) (by David R)
here is a set of code for the Pic and Micset.
please note the pic need to run fast with a fast crystal to process the incoming serial string.
Regards
David
(no subject) (by David R)
and the Micset file
(no subject) (by Carlos Torrez)
Thank you very much, for example, estimated David, but I tested with a PIC16F877 and does not work sending the data from the HMI to the PIC, the PIC to send the HMI if it works perfectly, when testing on Proteus, manually income data [2, 1, W, 1] and it works perfect, what could be the problem?
(no subject) (by David R)
What crystal and what scan time are you using ?
(no subject) (by Carlos Torrez)
ok, 20MHz scan 0.4
(no subject) (by David R)
Ok next can you please connect the serial port of the computer (com 1 ?) using A null modem cable to another serial port on the computer or another computer (com 2 ?)
open A terminal program (ie HyperTerminal) and set to (com 2 ?).
this allows you to see what Xedit sending.
Run Xedit and monitor what is sent from Xedit to the terminal program.
Press the buttons on Xedit and post the result.
Regards
David
(no subject) (by Carlos Torrez)
I tested with virtual ports to do what you ask tarry because I have only one PC.
Could you help by changing the model program PIC16F877? can you are doing something wrong. And send me the program PIC16F877?
Thanks in advance
(no subject) (by Carlos Torrez)
Ya encontre el problema estimado david elimine desde el proteus el VSM VirtualTErminal y funciona perfecto tu ejemplo.
gracias por tu tiempo
saludos
(no subject) (by Carlos Torrez)
Dear David, I found the problem removed from the VSM proteus VirtualTErminal and your example works perfect.
thanks for your time
However, your code can not understand 100% you could help me with more feedback, thank you
Greetings
(no subject) (by David R)
What part don't you understand ?
David.
(no subject) (by Carlos Torrez)
1 .- At line 11 [R_rx_char ]---[ C_char_cnt], which is the goal of using the counter move?
2 .- In line 17 where the coil Set [R_not_me], because the comparison? [address> char]
3 .- In line 19 why? is subtracted by 48 [dec: = char - 48]
4 .- To take another from the HMI tag lines should be repeated to increase more tag?
(no subject) (by David R)
1) the counter counts up a number every time the UART receives a character, this is so I know which character is being received and when to move it and when to move it.
2)as the data is received it needs to be checked that it is the correct data and is the correct format, so as each character is received the counter [ C_char_cnt] steps and the result from the lookup table is compared to the character, if it is not correct then the relay [R_not_me] is set which locks out the data receive until a new data string is received.
3)the decimal character "4" is not ascii "4" it is 52 see the attached chart.
4)I will post a new program with a small change to do that.
(no subject) (by David R)
4) just copy the last line and change the address and data to what you need.
you can only use 0-->9 for address
(no subject) (by Carlos Torrez)
I have not had time to discuss in detail your code but I still have doubts of the previous program, excuse my ignorance, I think this last code even more complicated than the first so I'd like to finish to understand the first code.
(no subject) (by deny_jae)
dear david,
how to know register address from PIC16F877?
can you explaint to me?...
sorry for my english..
Post a reply to this comment:
|