|
|
View previous topic :: View next topic |
Author |
Message |
hiromasakoh
Joined: 16 Jun 2004 Posts: 4
|
RS-232 with Compass---the simple question |
Posted: Wed Oct 20, 2004 9:46 pm |
|
|
Hello everyone....
I am a beginer of PIC microcontroller
Now I have a project which I must use RS-232 to read data from HMR-3300 digital compass...It's output ASCII format..
I want use RS-232 to receive compass data then trancelate to PC(hyperterm) to look these data..
but I don't know use what command to do it ..
Please help me and give me some suggestion
Thank you very much
Kind Regards
Herry |
|
|
Ttelmah Guest
|
Re: RS-232 with Compass---the simple question |
Posted: Thu Oct 21, 2004 2:21 am |
|
|
hiromasakoh wrote: | Hello everyone....
I am a beginer of PIC microcontroller
Now I have a project which I must use RS-232 to read data from HMR-3300 digital compass...It's output ASCII format..
I want use RS-232 to receive compass data then trancelate to PC(hyperterm) to look these data..
but I don't know use what command to do it ..
Please help me and give me some suggestion
Thank you very much
Kind Regards
Herry |
There is quite a lot of work in this, it really is a fairly 'hard' project to start with. Unfortunately, what you describe would be quite hard to do, since properly controlling the HMR, requires use of both the RS232 TX, and RX lines. This then implies that either a seperate UART would need to be added (or the use of one of the larger PIC's with two UARTs), or you are going to have to rely on 'bit banged' software serial for the link to the PC. This imposes some very tight timing constraints on the code. It would be _much_ simpler, to use the SPI port on the HMR module instead. Using this port, you would only need to send a 'H' command to the HMR, and would receive back the heading from the compass module, that can then be printed to the PC. Otherwise, I have to ask 'why add the PIC'?. The HMR, after a couple of fairly simple initialisation commands to set the baud rate, allready returns the serial data in ASCII text format, that is directly readable by hyperterm (with a suitable RS232 transceiver)....
Best Wishes |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Thu Oct 21, 2004 6:46 am |
|
|
Can you set the HMR3300 to periodically spew it data on its own? Then you can use one UART to read from the compass and talk to the PC. Even if that won't work in the final application it might be a place to start.
Generally the compasses I use in oceanographic gear are set to asynchronously send their data at a 1Hz rate. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Ttelmah Guest
|
|
Posted: Thu Oct 21, 2004 12:31 pm |
|
|
SherpaDoug wrote: | Can you set the HMR3300 to periodically spew it data on its own? Then you can use one UART to read from the compass and talk to the PC. Even if that won't work in the final application it might be a place to start.
Generally the compasses I use in oceanographic gear are set to asynchronously send their data at a 1Hz rate. |
Yes, The HMR, can be set like this. However it needs to 'see' a transmission to trigger it's baud rate detection. The easiest way, is going to be to have the outgoing hardware UART, driving the PC, the incoming hardware UART, used for the HMR, and use a software port to configure the chip. However there is still a lot of work to do, since he will have to 'parse' the incoming strings to get the required data, and generate his required outgoing strings. It really strikes, that he would be better starting out a lot simpler, and cracking basic PIC to PC comms first. It is a fairly simple project as a whole, but not an easy one to 'start' with...
Best Wishes |
|
|
Guest
|
|
Posted: Sat Dec 31, 2005 6:00 am |
|
|
Ttelmah wrote: | SherpaDoug wrote: | Can you set the HMR3300 to periodically spew it data on its own? Then you can use one UART to read from the compass and talk to the PC. Even if that won't work in the final application it might be a place to start.
Generally the compasses I use in oceanographic gear are set to asynchronously send their data at a 1Hz rate. |
Yes, The HMR, can be set like this. However it needs to 'see' a transmission to trigger it's baud rate detection. The easiest way, is going to be to have the outgoing hardware UART, driving the PC, the incoming hardware UART, used for the HMR, and use a software port to configure the chip. However there is still a lot of work to do, since he will have to 'parse' the incoming strings to get the required data, and generate his required outgoing strings. It really strikes, that he would be better starting out a lot simpler, and cracking basic PIC to PC comms first. It is a fairly simple project as a whole, but not an easy one to 'start' with...
Best Wishes |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|