TTL Levels for PULSIN

nfk

Senior Member
(I have searched here for the answer to this but can't find it - apologies if it is a dupe post)

I am having problems with reading pulses from a Futaba r/c receiver using a surface mount 28X1. The PIC and the receiver normally run at 5 volts but the signals from the receiver are set at 3 volts. The cause of this problem seems to be that the signal levels are too low for the PICAXE to detect.

If I run my board at anything between 2.6 volts and 4.8 volts
the PIC detects the pulse okay. Anything below 2.6 volts and the receiver
fails (and so is irrelevant) - anything above 4.8 volts and the PIC doesn't detect it. My guess is that at the higher voltage the 3 volts signal is not high enough for the PIC to register it in relation to its supply voltage.

As far as the circuit is concerned I only have a 100k pull-down resistor on the input - there is nothing in series.

Everything I have read suggests that the signal should be detected. David Lincoln's book says that it should detect anything >=2.5 volts. The data sheet says that VIL is set at 0.8V and VIH to 2V.

I can't see why this isn't working. Any suggestions?

Cheers,
Nigel

(Yes, I know I could probably use a pull-up resistor but I think the circuit should work as it is.)
 

Dippy

Moderator
Odd, I know nothing about Futaba but your tests imply the loigc aint compatible, so only questions:

1. Are you sure that the Futaba o/p is actually 3V? (Have you 'scoped it? Get one).
2. Which port on 28X1 are you using? Port A are TTLs, but Port C (pins 11 to 18) are Schmitt. Schmitts require >=4V input High and <=1V for Low @ Vdd=5V
3. Do you really need the pulldown? Not that 100k is going to do much except prevent float when disconnected. If Futaba is push-pull then no pulldown required.

Highs/Lows as you say @ 5V. Just to clarify TTLs for Vdd = 2-4.5V :-
High >= 0.25 VDD + 0.8
Low <= 0.15 VDD

So, should work if using TTL and everything happy.

You could try a pot/div with wiper to input, keep looking in code until 'ON' then measure the voltage at the pin with a multimeter.

When you hit problems like this it is good to 'scope at the pin in question.
It is also good to get a 'scope.... dunno how people do things without them personally but that's another story.

PS. As I say, I've never used Futaba. Whats the output drive circuitry on it?
 

Technical

Technical Support
Staff member
The book is wrong if it states this, the inputs on the 28X1 you are using has a threshold of 0.8x the supply voltage, which is why it stops working at higher supply voltages.
 

nfk

Senior Member
Many thanks for your help. Here are the replies...

Dippy
1. Yes, I have scoped the Futaba receiver and it's definitely 3 volts (with a rather excellent digital 500MHz HP scope leant to me by a friend that makes my Tektronix 2225 look very old fashioned!).

2. Ouch, ouch, ouch - you're right. This is not good. Basically this means you can't use a Futaba receiver on those pins - not good news at all for me. I guess the only way to fix this is with some kind of 'buffer' (not sure if this is the correct term) to 'convert' Schmitt to TTL. Another chip :-(

3. I need pulldowns because these ports will be used for a variety of different purposes - not just receiver inputs. For example, I'd like the facilty to be able to connect the input to the +5v (which is handy from a jumper-pin point of view).

I don't know what the output drive circuitry is on the Futaba receiver.

Technical
Thanks, yes it says on page 52...

"All PICAXE digital inputs and outputs operate at transistor-transistor logic (TTL) levels, which are as follows: High 1 >= +2.5 volts, low 0 < +0.5 volts."

I'm afraid that there are quite a few errors in the book. It really needs revising.

Nigel
 
Last edited:

Dippy

Moderator
Use an NPN/PNP arrangement to 'step up'. I'm sure I've seen an NPN/PNP for this in a single s/mount device somwhere.

But there are several ways to skin a possum. You may get a list of 'My Favourite' ways following....

PS. If it's better than my DPO4054 then I'll order one. Mine's made in China.


PPS. Always read the Data Sheet before designing ESPECIALLY S/M.
 
Last edited:

MFB

Senior Member
You could use a single NPN transistor, with the base driven from the 3 volt pulse via a 33K resistor and the collector taken to +5V via a 3.3K resistor. A potential problem is that the output from the collector will be inverted with respect to the transistor input. A second identical transistor circuit could be used to present the correct polarity to the PICAXE.

Alternatively, feed the pulse into the non-inverting input of an opamp that is powered from 5V. The inverting input of the opamp should be driven from about 1.5 volts. Which could be derived from the centre of a two resistor (15K to ground and 33K to + 5 volts) potential divider.

Provided that you use a rail-rail I/O type opamp, like the TS1871ILT, its output to the PICAXE will swing over the 5 volt range (and be non-inverting).
 

nfk

Senior Member
So, the search is on. I have 8 of these inputs to cope with so what I need is a (probably non-existant) device that has the following characteristics:

1. Gives a full 5 volts when it sees anything over about 2 volts

2. Can cope with large over-voltage, i.e. 13.5 volts (please don't ask)

3. Is available as an array of preferably 8 (but possibly 4) in a small SM package.

That's not asking too much - is it?

(Probably)

Cheers,
Nigel
 
Last edited:

hippy

Technical Support
Staff member
You don't need a full 5V out, only something which will take what the receiver puts out and converts that to what the PICAXE needs.

High-voltage tolerance can be achieved through current limiting resistors.

I haven't investigated the exact details of what you need or the solutions, maybe it is impossible, but it's probably well worth looking at 74HC373 and other commonly available logic chips.

An 8-way darlington driver may also do the job.

A 3V3 LDO could keep the PICAXE at a voltage where it always works, and it may even continue to work when the supply drops below 3V3. There may be some battery backup monitoring chips which might help switch between regulated and direct supply.
 

Dippy

Moderator
Yes, running PICAXE at a lower voltage is the simplest as long as there are no issues further along.

PLEASE read Data Sheets on logic chips. e.g. the 74HC373 looks good, but check out Vi(high) minimum at Vcc. The one I looked out needed min 3.15V @Vcc=4.5V . So, no advantage.

Perhaps checkout the 74ACT373 if you're going to run it and PICAXE @ 5V. The 'AC' version maybe OK but not guaranteed.

Come on lads... there must be more! I'll leave you to it, the pubs are open.
 

nfk

Senior Member
At the mention of the word 'pubs' I can immediately identify Dippy as my kind of person!!

Thanks for your help guys. I'll take a look at your suggestions.

Cheers,
Nigel
 

moxhamj

New Member
Re:
So, the search is on. I have 8 of these inputs to cope with so what I need is a (probably non-existant) device that has the following characteristics:

1. Gives a full 5 volts when it sees anything over about 2 volts YES

2. Can cope with large over-voltage, i.e. 13.5 volts (please don't ask) YES

3. Is available as an array of preferably 8 (but possibly 4) in a small SM package. NO


MFB answered the question in the post above this question- either use op amps or transistors. The answers above are for transistors. They are worth 7c or less each, and the resistors are 1-2c. If you hunt around you can probably get them in multiple units per package, but they are available singly in SM packages and 8 single packages may well be smaller anyway. I'd use surface mount BC547 transistors. Total cost for 8 level translators is going to be under 80c.
 

Dippy

Moderator
I'd forgotten about the over-voltage bit. So caution required re use of of Op-amps or comparators.

Like I said yesterday lunchtime, the simplest method is a couple of transistors, though the single transistor idea may be OK too as suggested.
There are tons of SMD transistors / dual transistors (NPN/NPN or NPN/PNP) / transistor arrays kicking about. My Farnell /RS catalogues are bursting with them.


nfk: " So, the search is on...."
- Sure is, and now it's your turn :)

It's a long job and I've got to rotovate the garden and whilst I'd love to sit for hours looking through a Farnell/RS Catalogue / Internet (but not Ebay) for you I've got to plant me spuds.
:(
 

nfk

Senior Member
Regarding running at low voltages, I have no plans to go lower than 4.5 volts although it amazes me how low these chips will actually go before failing.

Anyway, as you say, it's my turn now so I'll get on the case!

Thanks for all your help.

Nigel
 

Wrenow

Senior Member
I may be wrong, but I think this is a known issue with some Futaba RX's. You might try using a 4049 based servo buffer (aka "glitch remover"). There is some discussion here: http://www.rcgroups.com/forums/showthread.php?t=668465&page=2 and there are more discussions and even wiring diagrams on how to do this if you do a little Googleing. It is pretty simple, and the 4049s are pretty cheap (though it is, indeed, more chips). However, the 4049 doesn't need any other support components for this job, and most of it is just wiring one leg to the next. It also helps get rid of glitches (a good thing) while bringing the TTL levels up (as I understand its function).

Just a thought, though it is admittedly a bit above my paygrade, engineering-wise.

Good luck,

Wreno
 

hippy

Technical Support
Staff member
@ nfk : If you aren't ever operating below 4.5V then the problem is reduced to the system not working when the PICAXE is powered above 4.8V.

The obvious solution to me is to therefore only ever operate the PICAXE at or below 4.8V. At that voltage, the PICAXE outputs should be compatible with any 5V system it needs to drive without any interfacing and it will work fine ( already proven ) for the inputs without having to worry about input buffering or voltage conversion.

Options seem to be, powering the PICAXE through a 7805 then a diode to drop 0.3V-0.6V, putting diodes in the common-to-0V connection of a 3V3 LDO to jack that up by 1.2V or perhaps powering the PICAXE from a zener supply.

Dropping the 5V via a diode should be quite easy to test; cut the power track(s) and insert a diode.
 

nfk

Senior Member
Hippy,

I think you win the lateral thinking prize - I must admit I hadn't thought of running the PIC at a lower voltage - a very neat idea. However, my concern is that it will still be vulnerable to high voltages. I had initially designed in a voltage divider for this purpose thinking that the receiver would have a reasonably high output and would therefore be sensed by the PIC's input. Since this is not the case I think I'm going to have to find another way because ideally, as mentioned above, my inputs need to withstand 13.5 volts.

Wrenow,

Thanks for the pointer to the 4049 information. I need to spend some time reading this although at first glance the idea of a 4049 managing to remove glitches seems unlikely. If a PPM receiver sees a bad signal I don't think there's much that can be done about it other than the quasi-failsafe technique of repeating the last good pulse until you get another good one. But like I say, I need to read the article carefully (and there's a lot of it) because I am treading in areas beyond my ability.

The more I think about this the more I like the transistor idea, if only I can get my head around it...

Nigel
 

hippy

Technical Support
Staff member
Your inputs should withstand 13.5V with the addition of a 22K resistor in series with each line, the same way as the serial interface input works.

The question is, where is this 13.5V going to come from, and therefore why do you need to protect against that ? If the receiver is run off 5V it seems unlikely it's ever going to put out more than 5V.

I get this lingering feeling that you're not telling us the whole story here ?
 

moxhamj

New Member
Re "the more I like the transistor idea, if only I can get my head around it..."

When I first got into electronics I started with digital chips like AND and OR gates, and 555 timers. I got into transistors later, which is probably the opposite way older people did things. Transistors are not quite as simple as digital chips and some "how to" guides make things very complex. The circuit described by MFB is the one to use - would it help to have this drawn up as a schematic?

Essentially, digital chips like picaxes and logic gates work on voltages. 0V is off, and 5V is on etc. Transistors work with currents - put a little bit of current into the base and lots of current will flow through the collector to the emitter. The maximum current is usually determined by the load such as a led or a buzzer. So if you have a resistor on the base like a 2k7, and it all works fine for 5V, it will also work fine if you put 20V or more into that base resistor. A bit more current flows into the base, but the maximum current from the collector to the emitter is still determined by the load. The transistor is fully "on" in both situations.

I must say that when I first discovered transistors I had trouble seeing how such a simple and cheap component could actually do a task better than something that came in a DIP package.
 
Last edited:

Dippy

Moderator
DrAc: "chip component" ? - do you mean 'cheap'?

I get this lingering thought that we're going round in circles.... until a schematic is posted.

But whether you have direct connection at lower supply voltage or level shifting with PICAXE @5V there will still be a need for something to deal with the mysterious 13.5V.

And before people start listing their favourite Zener, I think a schematic is needed. If it's top secret then 'Good Luck' as I reckon all the necessary suggestions have been made with the limited info provided.
 

moxhamj

New Member
Yes, I did mean cheap component. I'm getting my merds wuddled.

I agree we need a schematic. A zener would work, or a transistor with the right base resistor, or a voltage divider. We need to know the range of voltages that should be a 0 and a 1.
 

moxhamj

New Member
I think I might have walked past a mirror or something. Why is it that I keep looking at people's necks all the time? Time to visit the blood bank again!
 

MFB

Senior Member
Best way to post schematics?

I would be happy to include schematics. I normally use the 'free' ExpressSCH drawing package and, when necessary, export bit map images to MS Word. Any suggestions on the best pay to post them on the forum?
 

Dippy

Moderator
Can't you export as a bitmap file, then JPEG it? Then in your Reply look down the page and you'll see "Attach Files" and a button marked "Manage Attachments" click it, and upload.
 

Wrenow

Senior Member
Wrenow,

Thanks for the pointer to the 4049 information. I need to spend some time reading this although at first glance the idea of a 4049 managing to remove glitches seems unlikely. If a PPM receiver sees a bad signal I don't think there's much that can be done about it other than the quasi-failsafe technique of repeating the last good pulse until you get another good one. But like I say, I need to read the article carefully (and there's a lot of it) because I am treading in areas beyond my ability.

The more I think about this the more I like the transistor idea, if only I can get my head around it...

Nigel
My (admittedly limited) understanding is that it is running the signal through an inverter, then reinverting, etc. to clean up the signal and restore it to full TTL voltage levels. Not entirely sure how it gets rid of the glitches (other than dropping stuff that is below its threshold), but the results shown on a scope in some of the discussions does, indeed, show a lot of the noise cleared out. There are apparently a lot of these in use in the RC community. I have started soldering one up, but have not put it in service (or on a scope) myself, yet.

Good luck,

Wreno
 

nfk

Senior Member
If it's top secret then 'Good Luck' as I reckon all the necessary suggestions have been made with the limited info provided.
Dippy, I think you have hit the nail on the head really. You have all been very helpful and it's really up to me to get on with it and solve the problem now - the answer has to be amongst the tips you've all given me.

(But I'd certainly be interested to see MFB's schematics.)

Cheers,
Nigel
 
Top