Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

74 Series Chips and 3.3V to 5V


  • Please log in to reply
30 replies to this topic

#1 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 22 June 2011 - 08:55 PM

I'm trying to link 8 x 74595s cascaded using the SPI interface. Tried a couple cascaded and that suggested that what I needed to do was going to work. So I have started work on a prototype board and hit a snag when the fourth IC was added, Went back to the breadboard and tried again and this worked with four ICs. Scratches head and looks at the differences.... The breadboard was powered by a 3.3 V supply (the Sparkfun breadboard supply) and tested in the same way as the prototype board. The prototype board was powered by a home made power supply delivering 5V (5.05V if the multimeter is to be believed) and should be capable of 2A given the right wall wart, with the inputs from the N+ being 3.3V with no level shifting. Tried powering with the breadboard supply set to 3.3V and this gave good results with ICs 1-3 whereas before it did not work at all when 4 ICs were in circuit. I'm beginning to think that a level shifter is needed between the N+ and the prototpye board. Am I heading in the right direction or have I missed something obvious? Thanks in advance, Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 23 June 2011 - 03:35 AM

Hi Mark. You wrote "74595"...it means "74HC595"? It is important that the chips are of the "HCmos" series, otherwise they aren't compatible with the Netduino logic. Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 23 June 2011 - 05:17 AM

They are 74HC595s

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 23 June 2011 - 06:55 AM

First off, originally (30+ years ago), the nominal TTL voltage was 5.1V. So 5 or 5.05 or even 5.5 Volts are not the problem for sure. Secondly, I don't think there is a problem with voltage levels. You are working on a serial circuit, thus the lines involved are minimal. Theoretically there's no overhead when linking several chips in a chain. Anyway, it comes in mind two possibilities: 1) there is some wiring error in the prototype board, or 2) the speed of the SPI is too high. My suspect is toward the 2nd choice. When you are working with megahertz signals any stray capacitance could be a problem, but also the inductive wiring. The easiest task you may try is to lower the SPI clock, maybe at the minimum: if it is working, the 2nd suspect is proven. However, the very best thing you may do, is to test the signals using a scope or a logic analyzer. I may suggest a scope than an analyzer, because it shows the signal distortion much better than a discrete sampler. Just a question: how do you say "is not working"? What's the behavior? Hope it helps. Cheers
Biggest fault of Netduino? It runs by electricity.

#5 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 23 June 2011 - 07:08 AM

Nevyn,

Just to be sure; 74HC595 or 74HCT595? They have a different input voltage range.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#6 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 23 June 2011 - 07:10 AM

Just a question: how do you say "is not working"? What's the behavior?

I get data on QA but no other pins. The test signal I am sending is the same to each chip in the chain and it is a rotating pattern of bits i.e.

byte data;
while (true)
{
    data = 1;
    while (data != 0)
    {
        // output data
        data <<= 1;
    }
}

Hmmm - never thought about the SPI speed - I'll check that later today when I get to sit in front of the kit.

I've checked and double checked the wiring (it was my first thought given this is a prototype board) and all looks good - no shorts, dry joints and the wires all go to where I expect them to go.

Thanks for the advice,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#7 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 23 June 2011 - 07:46 AM

Just to be sure; 74HC595 or 74HCT595? They have a different input voltage range.

Just checked the site I ordered them from and the part is listed as 74HC595. Will have a close look at the part number on the chips later.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#8 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 23 June 2011 - 11:40 AM

Mark, I've checked right now the specs of the HC595, and I think that the problem should be the SPI's clock speed. If you take a look at the AC characteristics, you'll see that the ST_CP-to-Q7 time is not zero. Instead is about 50ns for a 3V supply. Now, when 4 shifters are chained, that time will become 200ns. If you consider a SPI clock as "low" as 5Mhz, the period is just 200ns. Now, I cannot be sure, but that would explain the strange behavior of the 4th chip. The clock switches simultaneously for all the shifters, but the bit sequence comes in late after a certain number of cells. So, please, try it. If that's true, the Stefan's tutorial should be adjusted to explain that the number of shifters is not unlimited, but should be accomplished to a lower clock rate. Cheers
Biggest fault of Netduino? It runs by electricity.

#9 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 23 June 2011 - 12:10 PM

If that's true, the Stefan's tutorial should be adjusted to explain that the number of shifters is not unlimited, but should be accomplished to a lower clock rate.
Cheers

Indeed, I could also modify the code so it changes the clock rate according to the amount of IC's connected.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#10 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 23 June 2011 - 06:57 PM

So just made a few changes to the code and the setup and this is where I am now. I have dropped the clock speed to 10 KHz. The prototype board is hooked up to the same power supply I used on the breadboard with a wall wart (I have also tried 9V battery and the effect is the same). I have four 74HC595's (I've checked the chip markings) in a cascade. I have 8 LEDs connected to the outputs through resistors to ground. This is used to indicate the output of the chips as the software is running with a 100ms delay so I expect to see a cycle of the LEDs lighting 1 at a time in sequence. Scenario 1: Power supply configured to 5V. I see the first LED (QA) flickering about once per second. Scenario 2: Same software and hardware setup but with the power set to 3.3V. The LEDs flash in sequence as I expected. I need to get the scope set up to look at the the 5V scenario. Thanks in advance, Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#11 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 23 June 2011 - 07:45 PM

Just got to hook up the scope (Picoscope) to the prototype, the breadboard and the N+ (with the clock disconnected from the circuit). In all cases the clock looks more than a bit rough - see the attachement below. Chip select looks OK - nearly square, just a small ramp up and down. Data simlarly. Are the levels an issue though? Data is output at 2.5V for logic level 1, the clock averages out at under 2V with a peak of just under 3V with OE coming in at 3V for logic level 1. Looking at the data sheet Vhigh looks to be about 0.7 * Vcc (on average) so a clock of 2V with a peak just under 3V would be a problem. Regards, Mark

Attached Files


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#12 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 23 June 2011 - 08:01 PM

Power supply configured to 5V. I see the first LED (QA) flickering about once per second.

Sorry to hijack, but my guess is that Netduino cannot output voltage high enough for HC's logic level - usually, the logic high voltage (VIH) is about 70% of VCC, so at VCC = 5V VIH = 3.5 V. You'd probably need a level shifter.

#13 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 23 June 2011 - 08:04 PM

Sorry to hijack, but my guess is that Netduino cannot output voltage high enough for HC's logic level - usually, the logic high voltage (VIH) is about 70% of VCC, so at VCC = 5V VIH = 3.5 V. You'd probably need a level shifter.

That was my original thought - and there is no hijacking as far as I'm concerned - only people willing to help and that help is appreciated.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#14 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 24 June 2011 - 03:43 AM

The HC595 specs says clearly that the typical Vih is about 2.4V when powered at 4.5V (NXP page 9), so let's say 2.5V @5V. There are several circuits (e.g. the Szymon LCD driver) are working perfectly even without level shifter. However that is true *only* using HCmos chips though. What is *NOT* OK are the output levels of the Netduino. I measured the SPI lines right yesterday evening and they swing from 0 to 3.3V. Moreover, the wave shape MUST be perfect, not oddly shaped as the picture you attached. Please, disconnect the SPI lines and have a look at the waves shape with the scope. If you notice a voltage drop/distortion by attaching the chips there is *surely* something wrong in the circuit. Cheers
Biggest fault of Netduino? It runs by electricity.

#15 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 24 June 2011 - 05:56 AM

The HC595 specs says clearly that the typical Vih is about 2.4V when powered at 4.5V (NXP page 9), so let's say 2.5V @5V. There are several circuits (e.g. the Szymon LCD driver) are working perfectly even without level shifter. However that is true *only* using HCmos chips though.

Please, disconnect the SPI lines and have a look at the waves shape with the scope.
If you notice a voltage drop/distortion by attaching the chips there is *surely* something wrong in the circuit.
Cheers

I have tried this without the circuit attached and the distortion on the clock remains and it of a similar shape although the output never reached 2.5V, in fact it never reaches much more than 0.3V. I have also tried this with the N+ connected to 9V battery as well as USB and the results are the same.

Szymon's LCD driver only uses one 74HC595 - I can get this working with one, two and three, the circuit only fails when I get to four chips in the circuit. That's a problem for me as I need to get to eight.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#16 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 24 June 2011 - 06:22 AM

I'm going to make a test circuit this weekend, I'm curious, I think it's the lack of amperes. I have an idea how to bypass that limitation; by adding an external power source to the netduino and add an own 5V/1.5A Voltage Regulator on the VIN pin and use that one instead of the 5V pin on the Netduino.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#17 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 24 June 2011 - 07:03 AM

Mark, the problem *is* around the Netduino, because it is *not* normal that the outputs aren't correctly shaped. There's no apparent reason because the signal won't reach 3.3V and 0.0V without any load! At the moment I am in the office, probably today evening or tomorrow morning I'll post a picture taken from the scope with a well-shaped SPI lines. Finally, I may understand that over a certain numbers of shifters the circuit may fail, but it is also too strange (suspect) that it begins to fail *exactly* when you add the 4th chip. Cheers
Biggest fault of Netduino? It runs by electricity.

#18 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 24 June 2011 - 07:33 AM

I'm going to make a test circuit this weekend, I'm curious, I think it's the lack of amperes. I have an idea how to bypass that limitation; by adding an external power source to the netduino and add an own 5V/1.5A Voltage Regulator on the VIN pin and use that one instead of the 5V pin on the Netduino.

I can give that a go later as I have to build a 5V regulated supply for the project.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#19 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 24 June 2011 - 07:35 AM

I can give that a go later as I have to build a 5V regulated supply for the project.

Same here for my robot project :)
Was thinking of using voltage regulators but not sure how to yet, going to open a seperate thread :)

Edited by Stefan, 24 June 2011 - 07:51 AM.
had my question in this post but moved it to a seperate thread

"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#20 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 24 June 2011 - 05:09 PM

I did some testing with my bit shift project and schematic with 5 74HC595's in a row, on the 3.3V of the Netduino it works fine:


Click here for a large image

Only thing is, it only lets one led emitting at the same time, that's just because I didn't had 50 resistors on my hands at the moment :)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.