Low output voltage?

Hello all.

I just got my HiFive1 and have started programming it with the Arduino IDE. It is all going well except for the digital output voltage. I have probed with my multimeter and found that for both of these configurations, I am getting about 2.5V output with the IOREF jumper on 3.3V (marginally more on 5V):

pinMode(7, OUTPUT);
digitalWrite(7, HIGH);

pinMode(7, INPUT);

This also works on other pins. I trust this is due to some kind of pull-up resistor being enabled on the output as well, since the actual 3.3V output from the HiFive1 is good.

Any ideas on how to fix this? Thanks for any help!

Is that with nothing connected to the pin?

Note that the 3.3 V CMOS spec says acceptable output levels are 0 - 0.5 V for lo and 2.4 - 3.3 V for hi, so it’s within tolerances.

2.5 V should also be enough to convince 5 V CMOS or TTL that it’s seeing a hi.

Oh, that’s strange. When I disconnect the pin (input or output configured), I get a nice 3.35V off of it. So I guess that means that the output voltage is fine, but there is a pull-up resistor on output? Plugging a 1.6k resistor between the output and ground, I’m reading about 2V over the resistor, implying about a 1.25k resistor on the pin.

So you have about 1.25 mA through it.

AVRs can source 20 mA per pin, but I think that’s unusual. ARM Cortex M0 is 7 mA per pin. Sounds like this might put out about 2.5 mA max. I don’t know the spec.

Unless you’re driving LEDs directly, most circuits attached to AVRs tend to recommend maybe a 10k resistor (or input impedance) to an external amplifier/buffer, so this should be fine.

The spec to look at would be that of the level shifters. They have “smart” internal pull-ups which adjust their value based on what you’re driving. The HiFive1 doesn’t add any other pull-ups on the outputs.

Can you clarify your example code? When you set a pin to input mode, its output is High-Z. So I’m not sure if you are measuring the voltage before the pinMode(INPUT) call.

Seems like that’s TI TXS0108ERGYR

The low level output voltage graphs on P14 show a maximum current of 1000 uA giving about a 0.5 V output.

The pull-up resister on the B (3.3V/5V) port side is 4k when the output is high , 40k when low. (Section 8.2, P17, under the diagram)

So the maximum current at 5V would be 1.25 mA with the output connected directly to ground.

Which is which I got from your measurements earlier…

Sorry, I think I’ve done a poor job at explaining this. To start at the beginning, my issues arose because I am trying to interface with an external Flash chip over SPI using SPI.h provided in the Arduino IDE. That wasn’t working as it should, so I probed some things and saw low SPI voltages on the pins. I broke out the CS and saw that when it is connected to the Flash chip, it is only reading a high of 2.0V (the voltage supplied to the chip looks good at about 3.2V). The 2.0V is well outside of tolerance however. I have configured the CS as an output and manually write it high and low, so I can watch it go between 0V and 2.0V. If I change the jumper to the 5V side, I can increase this to 2.4V.

To answer mwachs5’s question, there are actually two sample code things in the OP (i.e. two separate test binaries). They occur in the setup() function and I am probing during loop(). What was meant is that as far as I can tell, configuring a pin as an input is equivalent (in terms of output voltage) as configuring a pin as output and writing it high when it is connected to an LED (in this case).

I think the issue is that because of the “smart” pull-ups, it is trying to decrease current draw, but inadvertantly changing the signalling voltage, which is causing SPI to fail.

What is the current requirement of the SPI Flash chip for its I/Os?

I’m not certain (not the clearest datasheet for that), but it seems to be 1.6mA. Based on brucehoult’s comment, that won’t work. Am I interpreting that right? The Flash chip itself is the MX25L6405D.

Looking at page 30 of http://pdf1.alldatasheet.com/datasheet-pdf/view/267909/MCNIX/MX25L6405D.html

IOL = 1.6 mA. That’s the current the flash chip can supply as an output in lo output state. In hi output state (IOH) it’s -100 uA.

But that’s not what you want.

The current the flash chip draws on its inputs is at the top, ILI “input load current”. It’s 2 uA. That’s several hundred times less than you should be able to get out of the level converter.

To recognise a hi input it needs 0.7 VCC, so that’s 2.24 V if VCC is 3.2 V.

Should work!

If it’s the smart pullup being stupid then maybe you need to actually increase the current draw from the level converter a little? Sounds silly, but maybe an external 50k - 100k resistor to ground (which will try to pull about 30 uA - 60 uA out of the level converter) will make the smart pullup work better, while still leaving the output voltage ok? (certainly no less than 20k, otherwise you’ll pull the output voltage down too much)

… or maybe even 200k or 500k. The fewer wasted uA the better! 1M might be too much, as that will only add 3 uA to the 2 uA taken by the flash. OTOH, it might be just enough to make the difference!

I think I’m going to have to do some more in-depth looking into this board over the coming days when I have more time. I’ll give your suggestions a try, give all the docs a good read, and report back when I can. Fortunately I got the Flash programmed with my Raspberry Pi, so I’m no longer concerned about that. Thanks for all the suggestions and your time brucehoult, it is greatly appreciated!

Hi…i am a new user here. I am not sure about but ARM Cortex M0 is 7 mA per pin.This might put out about 2.5 mA max. If you’re driving LEDs directly, most circuits attached to AVRs tend to recommend maybe a 10k resistor.

pcb assembly

Hi…i am a new user here. As per my knowledge AVR can source 20 mA per pin and ARM Cortex M0 is 7 mA per pin. If you are driving LEDs directly, most circuits attached to AVRs tend to recommend maybe a 10k resistor to an external amplifier, so this should be fine.