Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help Please

Status
Not open for further replies.

YAN-1

New Member
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 :oops: ). 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.
 

Attachments

  • hmr32003300.pdf
    167.5 KB · Views: 274
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).
 
This is simple:

UART= Universal Asynchronous Receiver-Transmitter <Asynchronus only>
USART= Universal Synchronous/Asynchronous Receiver/Transmitter <synchronus or asynchronus>
SPI=Serial Peripheral Interface <synchronus only>

USART can be set to be either synchronus or asynchronus (UART)
 
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?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top