Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

USART Pic Serial communication

Status
Not open for further replies.

Kunal2

Junior Member level 3
Joined
Jun 21, 2011
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,512
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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top