When I connect my compass to my PC (hyperterminal) I can see data strings comming out of it.
When I send the same strings (from hyperterminal) to microcontroller it works, but when I connect directly compass to microcontroller it doesn't work. Why?
Check the compasse’s output levels ..
It’s quite possible (and very likely) that it is an RS-232 device but with 0-5v output ..
Most computers will happily accept 0-0.5 as -3 to -25V and 4-5V as +3 to +25V..
If your microcontroller has RS-232 driver such as MAX232 (or similar) it will not accept anything close to 0V as negative level and therefore will not produce required logic H(igh) ..
Check the compasse’s output levels ..
It’s quite possible (and very likely) that it is an RS-232 device but with 0-5v output ..
Most computers will happily accept 0-0.5 as -3 to -25V and 4-5V as +3 to +25V..
If your microcontroller has RS-232 driver such as MAX232 (or similar) it will not accept anything close to 0V as negative level and therefore will not produce required logic H(igh) ..
Hi,
And if what Ianp told is true, you can simply use a 74HC14 on your microboard instead of Max 232 and it will solve the problem, but then, if you want to connect to computer from micro, you need to limit the voltage out put from PC to micro using a resistor and a zener to 5V/-.6V
Regards, Laktronics