I've got a cheapo Nano clone, the digital output of the pin only hits 4.6-4.8v high, but then drops to only 1.3v or so for the low. Just testing really, with the blink example changed for 5 sec on, 5 sec off to allow for reading the voltage.
I'm pretty sure this is messing with my circuit - I'm using this as the hv1 input to one of those bi-directional logic level shifters, trying to convert the 5v to 3.3v. what I want to see is Dout goes high, converts to a 3.3v high.
Same setup works fine on an Uno. But not the clone nano. The Uno hits 5.1 high, 0 low though.
Would the 5.5 hi 1.3 lo be my problem? Would a pulldown resistor on the Dout of the nano properly force it to 0v nd possibly fix my problem?
What's connected to the output pin? Can we see a schematic? What happens when nothing is connected except your meter?
I'll look for the output specs, but anything below 1.5V on an input is read as low, and anything above 3.5V will read high. In-between is undefined and can read high or low.
...OK, Output-low should be 0.8V or less at 20mA. Output high should be 4.1V or more at 20mA. That's with a 5V power supply. More current makes those "worse" (unspecified) and less current makes them "better".
That output specs are ALWAYS more strict than the inputs so if you write low you ALWAYS read low (with a connection to a similar device) and if you write high you ALWAYS high. (That's assuming the voltage & current are within spec.)
A classic Nano simply uses a diode for USB backflow protection, which drops about 0.4volt.
So VCC of a Nano on USB power is about 5 - 0.4 = 4.6volt.
An Uno/Mega uses a more complicated circuit there, with an opamp and mosfet.
So VCC is much closer to USB voltage on those boards.
Not that it matters for most projects.
LOW should be close to zero though.
Did you set the pin to output with pinMode.
Leo..
To be a bit more clear, it is this level shifter that only seems to work with the Uno. It passes the 5v digital high from the Uno and converts to a 3.3 v pulse coming out the L1 pin. Same setup but using the Nano, no 3.3v pulse output from the L1 pin. It just remains in the 3.3 v state, as it does when nothing is hooked up to the H1/L1 pins at all.
You have to do better than that.
Some pins of the classic Nano are different. Pin13 is one of them.
It has no buffer for the built-in LED, so can give problems when used as input.
And there are Nanos and Nanos.
I assume you have a 16Mhz classic Atmega328 Nano.
But there are many others with different logic voltages. Some dumb-ass called them Nano too.
A mosfet level converter is just a switch. How LOW the pin will go still depends on the load on the other side.
Leo..
The way I read this thread, you're attempting to use D13 as a digital output feeding your level shifter, while still driving the LED.
With cheap Nanos, the LED and it's current limiting resistor may interfere with the levels you measure. You can test this by disconnecting your level shifter and measuring the voltage where you were connecting the level shifter's input, as the LED turns on and off. If that is the case, switch to a different digital pin(for example, D12), and see what voltages appear when the output is high and low.
C
Any chance you've drawn too much current from D11 in the past? The output current is 40 mA absolute max; an LED from output to 5V or ground, without a limiting resistor, will draw that...for a moment or two.
C
Possibly but I doubt it. Just put the bootloader on this chip before playing with it. And all my prototyping LEDs already have resistors soldered to em. But can't say definitively, I've been known to do that in the past...