Hi. I have found a suitable electronic compass that I want to buy. But I was reading the data sheets of the compass and they explain how to read the resulting heading. They said the methods of communication are either SPI or UART. I am really rusty when it comes to serial protocoles, but can any of you please take a look at the datasheets and see the pin assignments of the compass and the timing requirements and tell me if I can use a 16F877 to communicate with the compass or not?
I know this PIC has an SPI and a USART module (not UART, but i'm not sure if that is a problem ). But I thought these protocoles were standard and I don't understand the things that the datasheets are requiring in terms of timings and sequences. I will greatly appreciate you taking the time to guide me. Thanks.
The USART includes a UART as well, you can set it to be either, it's likely to be the easiest option for you. You can also easily do it just in software, by writing a software UART, which my tutorials show how to do (as well as using the hardware USART).
Ok. So if the compass says it communicates through SPI or UART, and the 16F877 has those modules, then it should work, right? I mean these protocols and the signals involved in them are standard, right?