VOGONS


TinyLlama (Vortex86EX SBC)

Topic actions

Reply 560 of 659, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

@rasteri Since (I believe) you are the author of the BIOS used by the Tinyllama, could you please take a look at this issue I am trying to figure out with the creator or JEMMEX? --> https://github.com/Baron-von-Riedesel/Jemm/is … ment-1574798205

It seem that the BIOS isn't reporting the reserved memory areas correctly (VGA ROM, etc) so memory managers and games have a hard time on the Tinyllama because of this.

Reply 561 of 659, by rasteri

User metadata
Rank Member
Rank
Member
vanfanel wrote on 2023-06-03, 16:45:

@rasteri Since (I believe) you are the author of the BIOS used by the Tinyllama, could you please take a look at this issue I am trying to figure out with the creator or JEMMEX? --> https://github.com/Baron-von-Riedesel/Jemm/is … ment-1574798205

It seem that the BIOS isn't reporting the reserved memory areas correctly (VGA ROM, etc) so memory managers and games have a hard time on the Tinyllama because of this.

I didn't write the BIOS. I've never even successfully compiled it 🤣

Reply 562 of 659, by Duffman

User metadata
Rank Member
Rank
Member

@vanfanel

Eivind wrote the BIOS - source code here - https://github.com/eivindbohler/tinyllama2-bios

MB: ASRock B550 Steel Legend
CPU: Ryzen 9 5950X
RAM: Corsair 64GB Kit (4x16GB) DDR4 Veng LPX C18 4000MHz
SSDs: 2x Crucial MX500 1TB SATA + 1x Samsung 980 (non-pro) 1TB NVMe SSD
OSs: Win 11 Pro (NVMe) + WinXP Pro SP3 (SATA)
GPU: RTX2070 (11) GT730 (XP)

Reply 563 of 659, by Eivind

User metadata
Rank Member
Rank
Member
Duffman wrote on 2023-06-04, 05:08:

@vanfanel

Eivind wrote the BIOS - source code here - https://github.com/eivindbohler/tinyllama2-bios

I didn't exactly write the BIOS, I only modified/enhanced DMP's branch of Coreboot/SeaBIOS from 2013.

@vanfanel: I commented on that jemm github issue.

The LlamaBlaster sound card
ITX-Llama motherboard
TinyLlama SBC

Reply 564 of 659, by vanfanel

User metadata
Rank Newbie
Rank
Newbie

@rasteri, sorry, I thought you did it since you started building Vortex86 PCs a couple of years ago.

@Eivind: Thanks! I hope we can work around the last remainig compatibility issues of the TinyLlama eventually! They seem to be related to BIOS memory management so I guess they are solvable eventually.

Reply 565 of 659, by poprhythm

User metadata
Rank Newbie
Rank
Newbie
Eivind wrote on 2023-04-22, 01:04:
Aaron707 wrote on 2023-04-22, 00:23:

Thank you for the idea. I think I will try the diagram here: https://hackaday.io/project/12782-orange-pi-p … -and-status-led
Looks like a PNP transistor on pin-2 of the SD card slot might do it. When the 5v signal goes low on the base it will trigger the LED. I will get a BC557 PNP transistor to try next week.

The Vortex86EX runs the SD card in "SD mode", where pin 2 is DAT3. I dunno if this is the best signal to use as an activity indicator, maybe it would be better to use pin 3 (CMD). You could try experimenting and see which one works best?

I got one of these guys to experiment with. Hooked up the circuit that Aaron had linked to and it worked right away. Used a 2N3906 PNP transistor. Either pin 2 or 3 works, I can't tell a difference for disk activity. Pin 2 drops from ~2.48v at high to 1.5v at low, while pin 3 drops to ~2.2v at low.
DSC-1070.jpg

Second, it's good practice to add a resistor between the signal and the base of the transistor, as not to let too much current pass through and mess with the signal. Not sure it's absolutely needed in this case, but better to be safe than sorry. Try searching for some kind of transistor calculator online to figure out the best resistor value for driving the led (as high a resistance as possible while low enough to properly open the base-collector path of the transistor).

I looked at this calculator for transistor resistor values between signal and base, but I don't know the load resistance or current for the SD cable signal. I attached a multimeter on the µA setting between pin 2 and ground which reported 800µA when the card wasn't being accessed. But this test seemed to interfere with the signal quality - it produced read errors when trying to copy a file. Anyway, I plugged in iL = .8A, VCC = 5V, Vi = 2.5V (or 3.3?) to the calculator, which split back the Rb should be 31 ohm.

I then did some trial and error with different resistor values, from none up to 10K ohm. It worked every time, although the LED definitely got dimmer above 1Kohm.


Edit: so OK, so this electronics newb got my unit conversion wrong on the µA to A. I plugged in .0008 and got 30K ohm. I’ll give that a shot, and maybe adjust the LED resistor down if it looks like it’s not getting enough juice.

Last edited by poprhythm on 2023-06-16, 13:08. Edited 1 time in total.

Reply 566 of 659, by Eivind

User metadata
Rank Member
Rank
Member
poprhythm wrote on 2023-06-06, 19:38:

I got one of these guys to experiment with. Hooked up the circuit that Aaron had linked to and it worked right away. Used a 2N3906 PNP transistor. Either pin 2 or 3 works, I can't tell a difference for disk activity. Pin 2 drops from ~2.48v at high to 1.5v at low, while pin 3 drops to ~2.2v at low.

Not sure I understand what's going on here... You're talking about measuring the voltage between GND and either pin 2 or pin 3 of the microSD card? I hope you're using an oscilloscope - if not, you're going to see an average of the signal jumping back and forth between ~3.3V and 0V.

poprhythm wrote on 2023-06-06, 19:38:
I looked at this calculator for transistor resistor values between signal and base, but I don't know the load resistance or curr […]
Show full quote

I looked at this calculator for transistor resistor values between signal and base, but I don't know the load resistance or current for the SD cable signal. I attached a multimeter on the µA setting between pin 2 and ground which reported 800µA when the card wasn't being accessed. But this test seemed to interfere with the signal quality - it produced read errors when trying to copy a file. Anyway, I plugged in iL = .8A, VCC = 5V, Vi = 2.5V (or 3.3?) to the calculator, which split back the Rb should be 31 ohm.

I then did some trial and error with different resistor values, from none up to 10K ohm. It worked every time, although the LED definitely got dimmer above 1Kohm.


Edit: so OK, so this electronics newb got my unit conversion wrong on the µA to A. I plugged in .0008 and got 30K ohm. I’ll give that a shot, and maybe adjust the LED resistor down if it looks like it’s not getting enough juice.

You seem a bit confused about how this works, let me try to explain! 😀 First, LEDs: they're diodes and will happily gobble down all the current you give them, so you need to control that yourself. For a normal 5V-rated LED, something like 2-10mA through the LED works pretty well. In order to achieve that, take the vcc, subtract the LED's rated forward voltage drop (normally 1.7-2.3V, read the specs) and divide the result by the current you want, in Amps. So for instance, (5V-2V)/0.01A = 300 ohms. That's the resistor value you want in series with the LED, and that should be what decides its brightness, not the transistor's saturation level (which you want fully saturated when active).

As for the value of the transistor's base resistor, yeah that calculator gives you an estimate - but you have to find the correct Hfe (current gain) for a particular transistor and circuit setup. Datasheet is your friend. Also, the "Vi"on that calculator should be 3.3V.

Btw, if I'm looking at your photo correctly, you've hooked up the transistor the wrong way - for a PNP transistor, the collector should go through the load (resistor+LED) and then to GND, whereas the emitter should be connected to VCC.

Finally - like we discussed earlier in this thread, it's probably not a good idea to connect a sensitive signal to anything that'll draw a meaningful amount of current, like the base of a transistor. It'll likely be just fine, but no guarantees. What you want instead is a high-impedance input. That'll be the gate of a mosfet - either a discrete one or the input of a logic gate.

For my next ITX-Llama board, I'll try hooking up the CMD line (active-low) of the microSD connector to the input of an inverter, and then use its output (active-high) to drive the gate of an NPN mosfet that'll be able to supply the necessary current for both an internal and an external activity LED.
(For anyone wanting to point out I could just use a single PNP mosfet instead, yeah but it's hard to find one with the correct Vgs(th) levels when driven by 0-3.3V and controlling 5V 😉 )

The LlamaBlaster sound card
ITX-Llama motherboard
TinyLlama SBC

Reply 567 of 659, by poprhythm

User metadata
Rank Newbie
Rank
Newbie
Eivind wrote on 2023-06-07, 16:47:
Not sure I understand what's going on here... You're talking about measuring the voltage between GND and either pin 2 or pin 3 o […]
Show full quote
poprhythm wrote on 2023-06-06, 19:38:

I got one of these guys to experiment with. Hooked up the circuit that Aaron had linked to and it worked right away. Used a 2N3906 PNP transistor. Either pin 2 or 3 works, I can't tell a difference for disk activity. Pin 2 drops from ~2.48v at high to 1.5v at low, while pin 3 drops to ~2.2v at low.

Not sure I understand what's going on here... You're talking about measuring the voltage between GND and either pin 2 or pin 3 of the microSD card? I hope you're using an oscilloscope - if not, you're going to see an average of the signal jumping back and forth between ~3.3V and 0V.

poprhythm wrote on 2023-06-06, 19:38:
I looked at this calculator for transistor resistor values between signal and base, but I don't know the load resistance or curr […]
Show full quote

I looked at this calculator for transistor resistor values between signal and base, but I don't know the load resistance or current for the SD cable signal. I attached a multimeter on the µA setting between pin 2 and ground which reported 800µA when the card wasn't being accessed. But this test seemed to interfere with the signal quality - it produced read errors when trying to copy a file. Anyway, I plugged in iL = .8A, VCC = 5V, Vi = 2.5V (or 3.3?) to the calculator, which split back the Rb should be 31 ohm.

I then did some trial and error with different resistor values, from none up to 10K ohm. It worked every time, although the LED definitely got dimmer above 1Kohm.


Edit: so OK, so this electronics newb got my unit conversion wrong on the µA to A. I plugged in .0008 and got 30K ohm. I’ll give that a shot, and maybe adjust the LED resistor down if it looks like it’s not getting enough juice.

You seem a bit confused about how this works, let me try to explain! 😀 First, LEDs: they're diodes and will happily gobble down all the current you give them, so you need to control that yourself. For a normal 5V-rated LED, something like 2-10mA through the LED works pretty well. In order to achieve that, take the vcc, subtract the LED's rated forward voltage drop (normally 1.7-2.3V, read the specs) and divide the result by the current you want, in Amps. So for instance, (5V-2V)/0.01A = 300 ohms. That's the resistor value you want in series with the LED, and that should be what decides its brightness, not the transistor's saturation level (which you want fully saturated when active).

As for the value of the transistor's base resistor, yeah that calculator gives you an estimate - but you have to find the correct Hfe (current gain) for a particular transistor and circuit setup. Datasheet is your friend. Also, the "Vi"on that calculator should be 3.3V.

Btw, if I'm looking at your photo correctly, you've hooked up the transistor the wrong way - for a PNP transistor, the collector should go through the load (resistor+LED) and then to GND, whereas the emitter should be connected to VCC.

Finally - like we discussed earlier in this thread, it's probably not a good idea to connect a sensitive signal to anything that'll draw a meaningful amount of current, like the base of a transistor. It's most likely be just fine, but no guarantees. What you want instead is a high-impedance input. That'll be the gate of a mosfet - either a discrete one or the input of a logic gate.

For my next ITX-Llama board, I'll try hooking up the CMD line (active-low) of the microSD connector to the input of an inverter, and then use its output (active-high) to drive the gate of an NPN mosfet that'll be able to supply the necessary current for both an internal and an external activity LED.
(For anyone wanting to point out I could just use a single PNP mosfet instead, yeah but it's hard to find one with the correct Vgs(th) levels when driven by 0-3.3V and controlling 5V 😉 )

Thank you so much for the time in that explanation! I've still a lot to learn. I hooked up an oscilloscope to those two pins on the SD card connection, here are the results:

SDS00002.png
Activity on CS pin while copying file

SDS00004.png
Activity on CMD pin while copying file - Low voltage reading

SDS00005.png
- High voltage reading

I have one MOSFET component on hand, RFP30N06LE, but I feel like it's not the right kind. It's an N type and has a min gate threshold VGS(TH) of 2V:

DSC-1075.jpg Data sheet

This lights up weakly when first plugging in the USB connection (the reading on the oscilloscope looks like it's maxes out at about 3V during this period) but doesn't come on again afterward. This makes sense if the threshold is at 2V and the high voltage from the SD reader is slightly below that. This guide from the Arduino docs recommends the 2N7000 or BSS138 MOSFETs converting 3.3v logic to 5v, so I'll look at picking up one of those.

To keep using an N-type MOSFET and inverting the signal beforehand like you suggest, do you have any go-to recommendations for a component or circuit? I'm looking through some guides such as this on using op amp to invert signal, but it's taking a minute to get my head around the negative feedback. I'll keep reading.

Reply 568 of 659, by Eivind

User metadata
Rank Member
Rank
Member
poprhythm wrote on 2023-06-08, 16:49:

To keep using an N-type MOSFET and inverting the signal beforehand like you suggest, do you have any go-to recommendations for a component or circuit? I'm looking through some guides such as this on using op amp to invert signal, but it's taking a minute to get my head around the negative feedback. I'll keep reading.

I still don't quite understand the voltage readings you're getting. The signals should be around 3.3V high and 0V low. Btw, I'm not sure you said what your use case for all of this is? Did you build a TinyLlama or order one from me, and are you trying to hook up a SD card activity LED? Or is this for another project?

Anyways, here's the relevant schematics for the activity LED setup on my ITX-Llama board:

Screenshot 2023-06-09 at 10.02.43.png
Filename
Screenshot 2023-06-09 at 10.02.43.png
File size
61.32 KiB
Views
1509 views
File license
Fair use/fair dealing exception

The inverter is a standard 74LVC1G04 (1-gate inverter). It's driven by 3.3V, has its input registering low at around <0.8V and high at around 2V. It outputs 0V low and 3.3V high.
The N-channel enhancement mosfet is a BSS138K with a Vgs(th) of 0.6-1.2V.
The "SD_LED_NEG" line goes to the front panel hdd activity led's negative pin, and the positive pin is tied to VCC (5V) (edit: through a resistor, of course).

Last edited by Eivind on 2023-06-11, 21:54. Edited 1 time in total.

The LlamaBlaster sound card
ITX-Llama motherboard
TinyLlama SBC

Reply 569 of 659, by poprhythm

User metadata
Rank Newbie
Rank
Newbie
Eivind wrote on 2023-06-09, 08:20:

I still don't quite understand the voltage readings you're getting. The signals should be around 3.3V high and 0V low. Btw, I'm not sure you said what your use case for all of this is? Did you build a TinyLlama or order one from me, and are you trying to hook up a SD card activity LED? Or is this for another project?

Exactly, I'm building a TinyLlama and want to have an activity LED. Also, I recently ordered a wavetable adapter from you, I'm the one attempting to add a little llama on the case design 😀 . Thank you very much for the details with your design in the ITX, I'm going to attempt to replicate this for use with the TinyLlama.

I don't have the TinyLlama assembled yet, I've been testing with a USB SD Card reader using the sparkfun microsd sniffer. My assumption was that the signals and voltages would be analogous, but perhaps this is not the case.

I'd also like to use the activity signal to drive the HDD Clicker from Serdaco, I just received one today (along with a dreamblaster s2) and am anxious to try it out.

Reply 570 of 659, by poprhythm

User metadata
Rank Newbie
Rank
Newbie
Eivind wrote on 2023-06-09, 08:20:

Anyways, here's the relevant schematics for the activity LED setup on my ITX-Llama board:
Screenshot 2023-06-09 at 10.02.43.png

Here's a sketch of your circuit adapted for stand alone use with the TinyLlama. The only changes are the connections and adding a voltage divider to get 3.3V for the inverter, is that OK to use here?

2023-06-11-10-09-04-SD-Card-Activity-Schematic-Editor.png

Reply 571 of 659, by Eivind

User metadata
Rank Member
Rank
Member
poprhythm wrote on 2023-06-09, 18:50:

I'm the one attempting to add a little llama on the case design 😀 .

Aha! Yeah sorry I didn't connect your real name with your nick here on Vogons! 😀

poprhythm wrote on 2023-06-11, 14:18:

...adding a voltage divider to get 3.3V for the inverter, is that OK to use here?

In general, no. It's not a good idea to use a resistive voltage divider to step down the voltage used as a power supply. The reason is that the voltage at the output of the divider (also, at pin 5 on the inverter) will change based on the current flowing through it. I haven't done the math on this, and the inverter shouldn't be drawing _that_ much current, but you might risk it outputting too low a voltage on its pin 4 - resulting in an under-saturated mosfet and thereby dimming LED.
I would suggest you bringing 3.3V to the circuit directly from the TinyLlama. If that's not an option, use a simple and cheap LDO to step down the 5V to 3.3V instead. It burns away the current x (input - output voltage) as heat, same as the voltage divider, but unlike a voltage divider it _regulates_ its output voltage.

Edit: think about this - current will flow through the inverter (pin 5 to 3 and 5 to 4) with some kind of resistance, right? That is essentially another resistor in parallel with your R3 - and will affect the voltage at pin 5.

Edit 2: oh, and don't forget about adding a resistor in series with your front panel LED! If you connect an LED straight to the J2 connector, you'll instantly burn it out! :p

The LlamaBlaster sound card
ITX-Llama motherboard
TinyLlama SBC

Reply 572 of 659, by ahmadexp

User metadata
Rank Newbie
Rank
Newbie

@Rastri, I built your WeeCee and I am waiting for the SOMs. It was pretty straight forward. I wish we can combine the good stuff from Tiny Llama and WeeCee into one project. There are so many cool things in the Tiny Llama project like the HID converter, USB-C power, built in Power, Reset, MT32-Pi bottons, and the ESP Modem as well the MT32-Pi support (Eivind you did fantastic man). Anyways, Thank you to both of you, Eivind and Rastri. You guys are awesome. One last question for Rastri; is there any BIOS change necessary for the WeeCee project or not?

Reply 573 of 659, by poprhythm

User metadata
Rank Newbie
Rank
Newbie
Eivind wrote on 2023-06-11, 21:33:

I would suggest you bringing 3.3V to the circuit directly from the TinyLlama. If that's not an option, use a simple and cheap LDO to step down the 5V to 3.3V instead.

OK! I'm going to keep it down to one I looked over the circuit for the LDO and decided that yes, the little plug-in modules look like a good idea to keep that voltage well regulated. Grabbing a super cheap AMS1117-3.3 DC-DC Step-Down Power Module and will attach it to the "Conn_LDO" header.

2023-06-12-17-17-10-SD-Card-Activity-Schematic-Editor.png

I also added a a resistor for the external LED to simplify that connection. Thanks again very much, I'll post an update after its assembled.

Reply 574 of 659, by ahmadexp

User metadata
Rank Newbie
Rank
Newbie

Look how nice they turned.

Attachments

Reply 575 of 659, by Eivind

User metadata
Rank Member
Rank
Member
poprhythm wrote on 2023-06-13, 02:47:

OK! I'm going to keep it down to one I looked over the circuit for the LDO and decided that yes, the little plug-in modules look like a good idea to keep that voltage well regulated. Grabbing a super cheap AMS1117-3.3 DC-DC Step-Down Power Module and will attach it to the "Conn_LDO" header.

I also added a a resistor for the external LED to simplify that connection. Thanks again very much, I'll post an update after its assembled.

Yeah that should do the trick! 👍

ahmadexp wrote on 2023-06-15, 06:23:

Look how nice they turned.

Pretty! 😀 Nice work!

The LlamaBlaster sound card
ITX-Llama motherboard
TinyLlama SBC

Reply 577 of 659, by ahmadexp

User metadata
Rank Newbie
Rank
Newbie
ExplodingLemur wrote on 2023-06-15, 17:54:
ahmadexp wrote on 2023-06-15, 06:23:

Look how nice they turned.

Oh wow! Are those resin or a transparent filament?

Resin. Formlabs

Also for the RPi Zero 2W I took all the unnecessary (for MT32-pi) parts off. Here is a picture. This way you can bold a flat piece of copper on top of the Pi.

Attachments

Reply 578 of 659, by ahmadexp

User metadata
Rank Newbie
Rank
Newbie

I tried the Silicon Motion SM750 with HDMI output on my device and was unable to get any video output.
Here is the link to where I bought it from
https://www.ebay.com/itm/295434434943
Any suggestion helps