UART READ TEXT
Posted: 28 Apr 2012 10:14
Hi,
I can't really understand how to manage the data being received by the uart,
i want to read the data on text using select case procedure though i have several commands for it. im working for mikrobasic using PIC16F887
dim uart_rd as byte
if uart1_data_ready =1 then
uart_rd = uart1_read
select case uart
case LampOn -->first text i send from the host pc
portd.4 = 1
portc.5 = 1
case LampOff
portd.4 = 0
portd.5 = 0
case else
end select
delay_ms(100)
end if
I want to read the uart_rd as text as i send from host pc to mcu.
It comfiled but didn't work. I'm thinking what is the right declaration on how the mcu will read the text it received. But i have no problem on sending text to host pc since i'm using visual basic with select case procedure also which is working perfectly. But when i send the text to mcu, it can't read the same. My problem is that how to handle the text so that i cant On and OFF the port on mcu upon receiving command from the host. Hope anyone can understand.
To all masters please help us doing this, it would be helpful for me too much.
Thank you very much guys..i will wait for anyone can give me the right idea how to handle this
I can't really understand how to manage the data being received by the uart,
i want to read the data on text using select case procedure though i have several commands for it. im working for mikrobasic using PIC16F887
dim uart_rd as byte
if uart1_data_ready =1 then
uart_rd = uart1_read
select case uart
case LampOn -->first text i send from the host pc
portd.4 = 1
portc.5 = 1
case LampOff
portd.4 = 0
portd.5 = 0
case else
end select
delay_ms(100)
end if
I want to read the uart_rd as text as i send from host pc to mcu.
It comfiled but didn't work. I'm thinking what is the right declaration on how the mcu will read the text it received. But i have no problem on sending text to host pc since i'm using visual basic with select case procedure also which is working perfectly. But when i send the text to mcu, it can't read the same. My problem is that how to handle the text so that i cant On and OFF the port on mcu upon receiving command from the host. Hope anyone can understand.
To all masters please help us doing this, it would be helpful for me too much.
Thank you very much guys..i will wait for anyone can give me the right idea how to handle this