In the schematic below I use a classical setup for a logic level shifter. However, in this case, when using this for an SPI bus MISO signal the mosfet refuses to switch its drain to low. Attached scope output: yellow is MISO low level, blue is MISO high level.
Board track lengths for this circuit are less than 1cm.
Vcc in my case is 3.3V so a level shifter is not technically required but the issue is that the high level MISO can change -project dependent- from 3.3V to 5V. In the case of Vcc being 3.3V (as is in my current case) then also the resistor values R2, R4, R6 and R10 need to be 0 Ohm.
For this specific mosfet level shifter it does not matter if the high level voltage is equal to the low level voltage since it is the difference between gate and source voltage that decides whether the mosfet switches on or not (the gate-source threshold voltage is 1.5V max per the datasheet).
Switching on however does not occur, even after:
1. changing the mosfet to another BSS138
2. changing R8 from 10k to 1k
3. verifying this board for manufacturing defects
4. reducing the SPI bus speed from default 8MHz to 1MHz
The circuit does work when I short drain and source. But obviously that defeats the purpose.
have you tested it on multiple PCBs, or just one?
We have had boards with odd copper faults before now, even a couple of "bare board tested" ones that had traces of swarf in the solder resist causing erratic problems.
have you tested it on multiple PCBs, or just one?
We have had boards with odd copper faults before now, even a couple of "bare board tested" ones that had traces of swarf in the solder resist causing erratic problems.
I did check the tracks under microscope (double sided board), total length about 3cm so doable to verify; indeed in the past I had a delivery with erratic manufacturing errors on one design.
If you've got one of the cheap Chinese (Atmel based) component testers (and everyone should ) try checking the BSS138, the component tester will not only tell you it's basic specifications (and if it's working OK), but will tell you which pin is which. Not all devices have the same pinout, often different manufacturers use different pins - been there, been caught!.
If you've got one of the cheap Chinese (Atmel based) component testers (and everyone should ) try checking the BSS138, the component tester will not only tell you it's basic specifications (and if it's working OK), but will tell you which pin is which. Not all devices have the same pinout, often different manufacturers use different pins - been there, been caught!.
There are a good number of slightly different models available, but all are based on the original design - just with extras added - some are text displays, some are graphic displays. They are quite fun to build, I've made about 5 different ones
The one I use at work is a two line text display one.
It gets used most for confirming resistor values, with the stupid confusing colours on 1% and 0.5% resistors
There are a good number of slightly different models available, but all are based on the original design - just with extras added - some are text displays, some are graphic displays.
Off topic, but I bought one of these off ebay after seeing them mentioned in this thread; just received it today.
It's a graphical version with a flat pack clear case - and it is a very impressive little gadget!
Thanks MacIntoshCZ & Nigel for mentioning them & providing the extra info.
Off topic, but I bought one of these off ebay after seeing them mentioned in this thread; just received it today.
It's a graphical version with a flat pack clear case - and it is a very impressive little gadget!