Kunal2
Junior Member level 3
Hello all
I am currently writing a program for usuart serial transmission. However while reading the datasheet for the specific pic and referring to the notes on mikroBasic help, i am in a confusion. It is as follows:
dim received_byte as byte
main:
Usart_Init(2400) ' Initialize USART module
while true
if Usart_Data_Ready = 1 then ' If data is received
received_byte = Usart_Read ' Read received data
Usart_Write(received_byte) ' Send data via USART
end if
wend
end.
The above code is a library example. While coding there is nothing mentioned about the definition of the bits TXEN, SYNC,etc on the TXSTA....
Is it an error if i define TXSTA = $20 while coding in order to define what each bit is doing in the register?
Thanks for your usual help and cooperation.
REgards
Kunal
I am currently writing a program for usuart serial transmission. However while reading the datasheet for the specific pic and referring to the notes on mikroBasic help, i am in a confusion. It is as follows:
dim received_byte as byte
main:
Usart_Init(2400) ' Initialize USART module
while true
if Usart_Data_Ready = 1 then ' If data is received
received_byte = Usart_Read ' Read received data
Usart_Write(received_byte) ' Send data via USART
end if
wend
end.
The above code is a library example. While coding there is nothing mentioned about the definition of the bits TXEN, SYNC,etc on the TXSTA....
Is it an error if i define TXSTA = $20 while coding in order to define what each bit is doing in the register?
Thanks for your usual help and cooperation.
REgards
Kunal