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.

IR And UART

Status
Not open for further replies.
donniedj said:
Is this a "What I have done" or a "Can it be done" post? Because I would like to see if it can be done. Extra 74hc chips waste to much space for me but would still like to know.

No, it's more a "I only use BASIC, so would find it difficult doing it in software" or "it's got some internal hardware, so I'm going to use it regardless of how unsuitable it is" :D :D :D :D :D
 
I can code in a number of languages as well as ASM. I care about the clients budget, if I can get the job done quicker for them and spend less time debugging complex code because its easy to read and produces excellent asm and can write and debug it in a simulator before the board is even made then its the best choice.

Did you do any analyse on the differences between counting the number of 38khz pulses per bit or the fact that it "might" be 1 out (26us)?

Besides if you wanted to do PROPER IR coms you would never use serial anyway.

Even if the code was written in the worst possible fashion by the worst compiler, once its in the chip and it works, nobody is any the wiser and you can claim its 100% ASM which it will be!
 
Tim_B said:
I can code in a number of languages as well as ASM. I care about the clients budget, if I can get the job done quicker for them and spend less time debugging complex code because its easy to read and produces excellent asm and can write and debug it in a simulator before the board is even made then its the best choice.

I've no problem with using ANY language, and I've even written a BASIC compiler for PIC - but adding extra hardware, and doing a job in a completely unsuitable way, just because you're trying to use a specific language is rather silly!.

Did you do any analyse on the differences between counting the number of 38khz pulses per bit or the fact that it "might" be 1 out (26us)?

No, why bother, the pulses from the receiver are already incorrect (which is why you shouldn't use serial), making the transmitted pulses wrong isn't going to help any :D

Besides if you wanted to do PROPER IR coms you would never use serial anyway.

I wouldn't use serial for IR, and I don't, my IR tutorial uses the Sony SIRC's system.

Even if the code was written in the worst possible fashion by the worst compiler, once its in the chip and it works, nobody is any the wiser and you can claim its 100% ASM which it will be!

Correct, once it's in the chip (and code protected) no one will know!.
 
Nigel Goodwin said:
No, it's more a "I only use BASIC, so would find it difficult doing it in software" or "it's got some internal hardware, so I'm going to use it regardless of how unsuitable it is

Nice speculation/opinion, but that's not the case at all!

The onboard USART is always my first preference due to the fact that it has less code overhead and the inclusion of buffers. Not taking this road before (IR UART), thought it would be a great way to create IR modulated UART data (using the high speed AND gate). But thanks to the input of others, there are better ways to go about it (controlling the TRIS of the PWM output via a software UART routine)

As discussed earlier, this is completely achievable in software, and a couple of simple mod's in the Swordfish SUART (software UART) would lead to the same real life proven results by Tim as stated earlier :eek:
 
Tim_B said:
Did you do any analyse on the differences between counting the number of 38khz pulses per bit or the fact that it "might" be 1 out (26us)?


Not yet Tim, having some issues with my Plug-Pack power supply that I use with my lil breakout boards, I've got some untested code ready to go though
 
gramo said:
As discussed earlier, this is completely achievable in software, and a couple of simple mod's in the Swordfish SUART (software UART) would lead to the same real life proven results by Tim as stated earlier :eek:

The problem with it is reliability, the width of the pulses out of the receiver isn't the same as those supplied to the transmitter, and will vary from bit to bit depending on it being zero or one, as RS232 relies on accurate bit timing it severely reduces the reliability, and it's likely that some bit patterns will fail.

There are specific techniques used for IR or radio wireless transmissions, these are tried, tested, proven, and RELIABLE - crude serial techniques were dismissed years ago as too poor to be of use.
 
Nigel Goodwin said:
There are specific techniques used for IR or radio wireless transmissions, these are tried, tested, proven, and RELIABLE - crude serial techniques were dismissed years ago as too poor to be of use.


There sure are, but hopefully for my needs (also stated earlier ~1200 baud), it’s good enough, as Tim has a working 2400 baud application. If it works, it’s good enough.

It's completely understandable for high speed transmissions though.

I'll let you know how I go in a couple of days. Just put together a little debug routine as well that checks for data integrity - something I can leave running for a few days to clock errors
 
Nigel... the IRDA protocol is tried tested and true, and that's just a simple serial transfer over IR, no modulation. As long as there's a packet format which allows for error detection and it's bidirectional a 'crude' serial interface will work very well.
 
are you sure about that? Why then do all IR transceivers have extra circuit in them and cost >$5? And why has MAXIM made a chip for that with integrated amplification and pulse filtering etc... see the manual. It clearly states, that there is a circuit for modulating the signal... (box called ENDEC for both Rx and Tx). No-one uses unmodulated serial IR. It's just plain stupid...
 
I do not think that there is an denial that the IR signal is always modulated and with the IR detectors with the demodulators built in and costing only a few pence or cents more than a IR detector diode / transistor on its it would be daft not to use one.

What he is saying is that serial com's however its generated / received will work. As I found out! How you wish to generate the carrier is another matter. I have used a pic with a HPWM module built in and used that just gating the tris on and off.

Purest will always find fault with anything......

BTW I pay < £0.50p for my ir decoders.
 
EDIT; Didn't see you post, sorry Tim

For lower speeds, there's no advantage of using additional devices for this simple task

Tim has a fully functional 2400 baud application using the Software approach to modulate the UART IR signal. Mine will adopt the same method, but for a 1200 baud.

:)
 
Last edited:
blueroomelectronics said:
donniedj, just watched your coilgun fire three rounds.
Is it supposed to appear that the gun can fire three rounds that fast?

(if so check out the shadows as it appears the sun is going down pretty rapidly)

If not already, always go to the source. The source ends all ambiguity.
 
how to control the tristate of the PWM from UART?

Hi there --
Just a quick question -- how do you use the high/low state of the UART TX pin to tristate / un-tristate the PWM output? That sounds like a nice idea, but is there a way to do this easily?
thanks,
-David M.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top