Hi. I am using a 16F877 to communicate with an electronic compass. This is done through the UART port. In the datasheets of the compass, it says that I have to send it commands in ASCII form in order to have it execute several things. For example, if i send it *S<cr><lf>, then it starts/stops transmitting data. All of the commands are in the form of:
*X<cr><lf>, where X could be any letter.
Now my problem is that I am not sure how to send these things! I know how to operate the UART port and how to send bytes but, in this case, do I have to send 4 successive bytes (the '*', the 'S', the <cr>, and the <lf>)?? And if yes, how do I do that? I mean do I look for their ASCII codes and send them as integers or do I define a variable of type 'char' and do something like:
char data;
data = '*';
TXREG = data;
??
Please help. Thanks a lot.