EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

3.3v <> 5v interfacing @ 15Mhz

Started by Alison November 25, 2006

Alison wrote:

> Please may I ask for assistance? I need a reliable method of interfacing an > SPI SD/MMC card to a dsPIC. At the moment I'm using a 1k8/3k3 voltage > divider on the 5v ----> 3.3v signals, and connecting the 3.3v ----> 5v > signals straight to port.
[...]
> Q1. Would it be an idea to reduce the values of R1/R2 in the voltage divider > to achieve faster switching?
Interfacing fast logic signals trough the voltage dividers is a bad idea. You can get with the solutions like that at 100kHz, but not at 25MHz. Interfacing to a removable card in that way is even worse idea.
> Q2. Which commonly available ICs could perform this conversion at as much as > 25Mhz?
Using a buffer IC is the way to go. Consider 74HCT or 74LV series.
> Reliability is more important than cost.
Then you shoud definitely use the buffers. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
PeteS <PeterSmith1954@googlemail.com> wrote in message
news:1164475326.107709.59270@f16g2000cwb.googlegroups.com...
> Inline > > The limits of analysers is that they don't detect actual voltage > levels, of course, beyond what they have been set up for as a switching > threshold. >
Nods. I need to pickup the scope. Normally I wouldn't be doing electronics, my understanding is basic. I'm the developer :-) The electronics engineer is going through a mid-life-crisis and doesn't want to do electronics as it's not making him happy :-)
> 0.8V would be ViL (max), not ViH(min). >
This is where the that 0.8v ViH figure came from; http://www.retro.dial.pipex.com/io_volts.jpg That's a page from the dsPIC4013 manual. 70138D.pdf
> Which indicates ringing on the line without the resistor. >
That answers that then. That sounds good.
> 10cm on breadboard might be ok if the wires are routed appropriately. > As I note above, you seem to have ringing on the line. Try a 22 ohm > series resistor - that's what I have apart from the 4k7 (mostly) > pullups. A 10 - 22pF loading cap might help too, although you should > not need it on a properly laid out PCB. >
I'll look into that. I'm making a piggy back board to go straight under the chip at the moment, so that the card is connected with solid copper. I'm preparing myself to go for a buffer.
> > Once on a circuit board, 10cm is not a long way at 25MHz, but you > should probably set the line impedance controlled and terminate at each > end. Without looking at the datasheets I can't give any direct > assistance (and as I have to make dinner shortly I don't have the time > ;) >
It'll go onto it's prototype pcb once I've cleared up some of this. Hope you enjoyed it. We made turkey vegetable things on scewers. ;)
Joe G (Home) <joe.g@optusnet.com.au> wrote in message
news:45686b1e$0$9773$afc38c87@news.optusnet.com.au...
> Level shifters may do the trick > > http://www.standardics.nxp.com/products/levelshifters/ > > http://www.standardics.nxp.com/products/gtl/voltageclamps/ > > http://www.standardics.nxp.com/support/documents/logic/pdf/an10156.pdf > > http://www.standardics.nxp.com/support/documents/logic/pdf/an10145.pdf >
Thanks Joe, will read up shortly. :-)
Vladimir Vassilevsky <antispam_bogus@hotmail.com> wrote in message
news:99%9h.209$Py2.144@newssvr27.news.prodigy.net...

Hi Vladimir,

> > Using a buffer IC is the way to go. Consider 74HCT or 74LV series. > > > Then you shoud definitely use the buffers.
Would it be ok to suggest the most suitable ones from this list? http://www.rapidonline.com/productinfo.aspx?moduleno=67459 I have an account there and they're local so I can pickup on Monday a.m. Thanks :) Alison
Alison wrote:
> PeteS <PeterSmith1954@googlemail.com> wrote in message > news:1164475326.107709.59270@f16g2000cwb.googlegroups.com... > > Inline > > > > The limits of analysers is that they don't detect actual voltage > > levels, of course, beyond what they have been set up for as a switching > > threshold. > > > > Nods. I need to pickup the scope. Normally I wouldn't be doing > electronics, my understanding is basic. I'm the developer :-) The > electronics engineer is going through a mid-life-crisis and doesn't want to > do electronics as it's not making him happy :-)
You might be better off finding someone else who is qualified. Although this does not sound like a complex design, even simple logic level interfacing is not hard to do wrong.
> > 0.8V would be ViL (max), not ViH(min). > > > > This is where the that 0.8v ViH figure came from; > http://www.retro.dial.pipex.com/io_volts.jpg > > That's a page from the dsPIC4013 manual. 70138D.pdf
Yes, notice that the table says 0.8 Vdd, not 0.8 volts. That means the input thresholds are relative to the magnatude of the Vdd supply. In your case it would be 4.0 volts. No 3.3 volt logic will supply this high an output signal. If you want to meet the spec, you will need a dual supply level shifter on the DATA OUT signal from the SD Card. Or you can just use a transistor. A simple NPN transistor with two resistors will do the job as well if not better than a buffer. If you can't handle the inversion in software, you will need two transistors and three resistors.
> > Which indicates ringing on the line without the resistor. > > > > That answers that then. That sounds good.
"Indicates" and "is" are two different things. Diagnose ringing with a scope. I seriously doubt that you have enough ringing to cause a problem. Even if you had some ringing on the DATA OUT line, unless it were very severe, it would only delay the settling time. At the rates you are working at it is not likely that this truely is the cause of your problem. I suspect it is more likely that the ViH vs. VoH are what is hurting you. But the scope and/or volt meter will tell you better. When the output rises, the initial slope is fairly rapid, but it slows as it approaches Vdd. So if the clock is slow enough the VoH has risen to the full Vdd. With a faster clock the data is sampled on the still rising edge and may not have made it to the actual threshold voltage of the PIC input.
> I'll look into that. I'm making a piggy back board to go straight under the > chip at the moment, so that the card is connected with solid copper. > > I'm preparing myself to go for a buffer.
Make sure it is powered by 5 volts and the output rises fully to Vdd. Also make sure the input is compatible with 3.3 volt logic. I am pretty confident you can live a rich full life on this signal without a series resistor once you get the voltage levels correct.
rickman <gnuarm@gmail.com> wrote in message
news:1164488077.768603.173870@h54g2000cwb.googlegroups.com...
> > You might be better off finding someone else who is qualified. > Although this does not sound like a complex design, even simple logic > level interfacing is not hard to do wrong. >
That's not an option. My main job is as an adult escort and I've recently come back from Dubai for &#4294967295;3k. Nose through my /pub directory. There is no one else. No ones going to work on a project for 20y.o. Atari computers. This is out of enjoyment to achieve something other than wandering around shops buying underwear all day. ;-) I have a Computer Science degree which is useless, I did it because I enjoyed working with computers and simplicity, not jumping through corporate hoops for Directors who can just about type with one finger. This is just enjoyment and achievement for me to do something more.
> > Yes, notice that the table says 0.8 Vdd, not 0.8 volts. That means the > input thresholds are relative to the magnatude of the Vdd supply. In > your case it would be 4.0 volts. No 3.3 volt logic will supply this > high an output signal. If you want to meet the spec, you will need a > dual supply level shifter on the DATA OUT signal from the SD Card. Or > you can just use a transistor. A simple NPN transistor with two > resistors will do the job as well if not better than a buffer. If you > can't handle the inversion in software, you will need two transistors > and three resistors. >
I have no control over the interface. It's a hardware implemented SPI port. The closest I come is to the transmit and receive registers.
> > > Make sure it is powered by 5 volts and the output rises fully to Vdd. > Also make sure the input is compatible with 3.3 volt logic. I am > pretty confident you can live a rich full life on this signal without a > series resistor once you get the voltage levels correct. >
SUCCESS!! CPU Powered Up. [ DONE ] Powering Down SD Card. [ DONE ] Powering Up SD Card. [ DONE ] Resetting SD Card. [ DONE ] Sending CMD0x00. [ DONE ] Expecting 0x01 Response Token from CMD0. [ PASS ] Sending CMD0x01. [ DONE ] Expecting Valid Response Token from CMD1. [ WAIT ] Sending CMD0x01. [ DONE ] Expecting Valid Response Token from CMD1. [ PASS ] Sending CMD0x09. [ DONE ] 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF Storage Capacity Calculated in Megabytes. [ 0491 ] Sending CMD0x09. [ DONE ] 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF Increasing CLK Rate to 7.5Mhz. [ DONE ] Sending CMD0x09. [ DONE ] 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF Increasing CLK Rate to 15Mhz. [ DONE ] Sending CMD0x09. [ DONE ] 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF You're not going to like how I did it though...... The voltage dividers I've replaced with 5k 18-turn pots. They're set to kick out about 4.2v at the moment having checked on the meter, that's the CHIP SELECT, DATA IN, and, CLOCK lines. The 100ohm resister has been removed from the DATA OUT line. It's running reliably at 15Mhz. I just kept on adjusting the pots until the data became stable. The input lines are about 4v. Mmmmmm. Maybe... The DATA OUT is being driven higher now... The DO is being driven higher, about 4.2v What does that tell you about the signals? I have lots of transistors here, bags of different sorts from a workshop clearance a few years ago BC547C ?? Thanks, Alison
rickman <gnuarm@gmail.com> wrote in message
news:1164488077.768603.173870@h54g2000cwb.googlegroups.com...

> Yes, notice that the table says 0.8 Vdd, not 0.8 volts. That means the > input thresholds are relative to the magnatude of the Vdd supply. In > your case it would be 4.0 volts. No 3.3 volt logic will supply this > high an output signal. If you want to meet the spec, you will need a > dual supply level shifter on the DATA OUT signal from the SD Card. Or > you can just use a transistor. A simple NPN transistor with two > resistors will do the job as well if not better than a buffer. If you > can't handle the inversion in software, you will need two transistors > and three resistors. > >
Hi Rickman... ;-) Could you elaborate on this? I can do this now but I'm not sure what goes where in terms of; R1 R2 R3 T1 T2 Roughly what values? and where do things go, BCE? I'm fully stocked on resistors, and have quite alot of different PNPs and NPNs. Alison
Alison wrote:
> rickman <gnuarm@gmail.com> wrote in message > news:1164488077.768603.173870@h54g2000cwb.googlegroups.com... > > > > You might be better off finding someone else who is qualified. > > Although this does not sound like a complex design, even simple logic > > level interfacing is not hard to do wrong. > > > > That's not an option. My main job is as an adult escort and I've recently > come back from Dubai for =A33k. Nose through my /pub directory.
Interesting. I checked out every file including the logs. I can't say I feel your pain, but I get the idea.
> There is no > one else. No ones going to work on a project for 20y.o. Atari computers.
If it's a paying job they will!
> This is out of enjoyment to achieve something other than wandering around > shops buying underwear all day. ;-) I have a Computer Science degree whi=
ch
> is useless, I did it because I enjoyed working with computers and > simplicity, not jumping through corporate hoops for Directors who can just > about type with one finger.
Tell me about it. I am at a point where I could retire if I wanted to. I have found that jobs provide little satisfaction and I am about fed up with it. Too bad I'm too old to do what you do!
> This is just enjoyment and achievement for me to do something more.
Well, you may not like what I am going to tell you.
> > Yes, notice that the table says 0.8 Vdd, not 0.8 volts. That means the > > input thresholds are relative to the magnatude of the Vdd supply. In > > your case it would be 4.0 volts. No 3.3 volt logic will supply this > > high an output signal. If you want to meet the spec, you will need a > > dual supply level shifter on the DATA OUT signal from the SD Card. Or > > you can just use a transistor. A simple NPN transistor with two > > resistors will do the job as well if not better than a buffer. If you > > can't handle the inversion in software, you will need two transistors > > and three resistors. > > > > I have no control over the interface. It's a hardware implemented SPI po=
rt.
> The closest I come is to the transmit and receive registers.
That is the point of interface where you can invert the data if you want. But it is 6 of one and half dozen of the other. You can get a dual buffer in a package as small as a transitor if I can remember which one we use a lot. It is tolerant of up to +-7 volts on the input, but what you need is for it to be 5 volt powered and I don't recall if it is. Here is a dual N-FET which does not need the input resistor. EM6K1 is in stock at digikey. Or if that package is too small for you to solder, the FDC6305N is a bit larger and should work too. Just connect one FET input to the DATA OUT signal (a light pulldown will keep it from floating when the SD card is not inserted) with a pullup resistor to 5 volts. Connect the other FET to the first drain in the same manner with the second drain to the PIC input. This will give you a clean 5 volt transistion and your problems should be solved.
> > Make sure it is powered by 5 volts and the output rises fully to Vdd. > > Also make sure the input is compatible with 3.3 volt logic. I am > > pretty confident you can live a rich full life on this signal without a > > series resistor once you get the voltage levels correct. > > > > SUCCESS!! > > > CPU Powered Up. [ DONE ] > Powering Down SD Card. [ DONE ] > Powering Up SD Card. [ DONE ] > Resetting SD Card. [ DONE ] > Sending CMD0x00. [ DONE ] > Expecting 0x01 Response Token from CMD0. [ PASS ] > Sending CMD0x01. [ DONE ] > Expecting Valid Response Token from CMD1. [ WAIT ] > Sending CMD0x01. [ DONE ] > Expecting Valid Response Token from CMD1. [ PASS ] > Sending CMD0x09. [ DONE ] > 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF > Storage Capacity Calculated in Megabytes. [ 0491 ] > Sending CMD0x09. [ DONE ] > 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF > Increasing CLK Rate to 7.5Mhz. [ DONE ] > Sending CMD0x09. [ DONE ] > 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF > Increasing CLK Rate to 15Mhz. [ DONE ] > Sending CMD0x09. [ DONE ] > 00 26 00 32 1F 59 83 B7 E3 91 CF FF 92 40 40 11 9E AC FF > > > > You're not going to like how I did it though...... > > The voltage dividers I've replaced with 5k 18-turn pots. They're set to > kick out about 4.2v at the moment having checked on the meter, that's the > CHIP SELECT, DATA IN, and, CLOCK lines. The 100ohm resister has been > removed from the DATA OUT line. > > It's running reliably at 15Mhz. I just kept on adjusting the pots until =
the
> data became stable. The input lines are about 4v. Mmmmmm. Maybe... The > DATA OUT is being driven higher now... The DO is being driven higher, ab=
out
> 4.2v > > What does that tell you about the signals? > > I have lots of transistors here, bags of different sorts from a workshop > clearance a few years ago BC547C ??
No, I don't like how you did it. And you won't like why it works. By driving the SD card inputs to 4.2 volts you are forward biasing the protection diodes in the SD card. This pulls the Vdd on the card up higher so that the output voltage is higher. This is *very* bad. Don't expect your card to live a rich full life if you continue to do this. Much better would be to use a buffer on the DO output or to use the transistors. The BC547C should work just fine. The package is a bit large, but I guess that is not an issue. Connect two of them in the same manner as above, but with a 1 Kohm resistor in series with the base of the first. Use 1 Kohms for the two pullups and you can ignore the series resistor on the second. It is hard to describe well, so I made a drawing. http://www.arius.com/Transistor_Buffer.png
Alison wrote:
> rickman <gnuarm@gmail.com> wrote in message > news:1164488077.768603.173870@h54g2000cwb.googlegroups.com... > > > Yes, notice that the table says 0.8 Vdd, not 0.8 volts. That means the > > input thresholds are relative to the magnatude of the Vdd supply. In > > your case it would be 4.0 volts. No 3.3 volt logic will supply this > > high an output signal. If you want to meet the spec, you will need a > > dual supply level shifter on the DATA OUT signal from the SD Card. Or > > you can just use a transistor. A simple NPN transistor with two > > resistors will do the job as well if not better than a buffer. If you > > can't handle the inversion in software, you will need two transistors > > and three resistors. > > > > > > Hi Rickman... ;-) > > Could you elaborate on this? I can do this now but I'm not sure what goes > where in terms of; > R1 R2 R3 T1 T2 > > Roughly what values? and where do things go, BCE? > > I'm fully stocked on resistors, and have quite alot of different PNPs and > NPNs.
The drawing from my other post did not inititially include the BCE markings, so I added them. You can check the data sheet for the part to see where each function is on the package. This will be very non-critical in terms of transistor selected or resistor value. Just make sure you use an NPN or N-channel device.
rickman <gnuarm@gmail.com> wrote in message
news:1164502687.632716.140910@h54g2000cwb.googlegroups.com...
Alison wrote:

>It is hard to describe well, so I made a drawing.
>http://www.arius.com/Transistor_Buffer.png
Hi Rickman, thanks :-) I've since tried a 7407 out of my junk box which I've found out why it was in there, it's a dud. A level shifter is another option? I've seen mention of a zener and two resisters, yet have as yet to get past companies wanting to sell me examples and datasheets.. The 4.2v has been dropped back down to 3.3v but in my mind it makes me believe that the SD DATA OUT was the problem, in that the dsPIC wasn't registering a '1'. I was getting impatient, and had enough cards to risk blowing one or two. It will reliably register a '1' at low Mhz <1 when running at 3.3v. Makes me wonder about rise and capacitance?? Hey Rickman, thanks for checking out the /pub and replying. It's just a job for me, it pays the bills. I've done the going into work 9-5 and working for people that think that you just tell a computer, "Now nice new computer, just do THIS," and that it magically does it. My understanding here isn't hugely advanced. It's not hideously basic either. I've had no formal training. Call it just basic practical. tnx, Alison

The 2024 Embedded Online Conference