Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Stack Machine posted:


Ok. That's not terrible at 1kHz. So I guess I'll have to figure out how to use this setup to produce some Bode plots eventually. My current concern, though is the physical construction and presentation of these things, and how I'm going to power it all.

Isn't that what a band-limited square wave looks like after a set of transforms?

Also, is "shielded wire" a valid solution? Audio in airplanes often has runs of a few dozen feet, and it's in 2- or 3-conductor twisted shielded, with the shield only grounded at one end (usually at the audio panel). Even with LOTS of noisy motors and stuff around, there's typically not much audio hum in that system.

Adbot
ADBOT LOVES YOU

Shame Boy
Mar 2, 2010

Also since it came up in the recommended videos for that isolation transformer video, watch this old EEVBlog vid if you use an oscilloscope and work on anything connected to the wall:

https://www.youtube.com/watch?v=xaELqAo4kkQ

I have in fact detonated a probe by not paying attention to what I was doing, boy that was exciting. It just completely vaporized part of the metal and blew the plastic bits all the way across the room. The scope is somehow still alive, at least.

BattleMaster
Aug 14, 2000

Dawncloack posted:

Hello friends

I have some more questions on wheatstone bridges, just like last time.



1- Every single website I find tells me that the formula for the output voltage of a LM317 is Vout = 1.25*(1 + R2/R1), where, in this case, R2 is the 470 + 220 ohm resistors, and R1 is 220 ohm. However, when I apply the formula I don't get the result in the schematic, I get 5V instead. Am I going insane?

The 470 ohm resistor is a pot that is wired up to let you vary it from 0 to 470 ohms. So it looks like it should give you the ability to adjust it across a range of about 2.5 to 5.17 volts.

This "classic" kind of stuff with lots of resistors isn't really my strong point so I don't have any answers for your other questions, though!

Shame Boy posted:

Ah that makes a lot more sense, thanks.


Also double thanks for mentioning the 1V thing, I didn't even think of that.

Glad I could help; let us know how it turns out!

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

Dawncloack posted:

Hello friends

I have some more questions on wheatstone bridges, just like last time.



1- Every single website I find tells me that the formula for the output voltage of a LM317 is Vout = 1.25*(1 + R2/R1), where, in this case, R2 is the 470 + 220 ohm resistors, and R1 is 220 ohm. However, when I apply the formula I don't get the result in the schematic, I get 5V instead. Am I going insane?
You're right. The adjustment range is farther than suggested. The adjust pin should be about 1.25V below Vout.

Dawncloack posted:

2- The branch with the 130 ohm resistors and the 1K pot serves to tune. I imagine that the point is to change the pot so that the voltage that gets referenced and passed on to the middle of the second branch must be precisely half of the input voltage that all branches share.
I imagine that the point of having 130 resistors is that, if the 560 ohm resistors are unbalanced, the 130 branch has more weight (by virtue of carrying more current) so that the influence over the reference voltage is smaller than it would be otherwise. Am I on the right track ?

You can think of the two dividers as their thevenin equivalent if that helps. The pot changes both the thevenin voltage and resistance, from a little less than 130 ohms to a little more than 300 ohms, over a wide range of voltages. This is then paralleled with the second divider's thevenin equivalent, supply/2 at 280 ohms. Getting from there to the thevenin equivalent of the combined dividers is two resistors in parallel for the resistance and a third voltage divider to find the voltage. That's at least how I'd approach this.

Dawncloack posted:

4- A more general question: I am a student of EE in case peepz weren't suspecting it enough. Classical electronics like this (kirchoff, thevenin) are not my strongest suit. But I love them and find them useful! Any suggestions to get better at the whole "be able to lay down the essential equations of a circuit" thing? Because often I simply don't make the assumptions right. Mathing is hard. Thanks in advance.
I think validating your guesses/math with simulations/prototypes is a good way to build reliable knowledge. Validation is super important because it's the only way to screen out misconceptions. Then if your experiments/simulations don't get the results you expect you also have a new set of questions to ask. This has been my experience relatively recently because I was heavily on the "computer engineering" side of ECE throughout school and in my career but in the past 5 years or so I've picked up some much more analog projects.

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

babyeatingpsychopath posted:

Isn't that what a band-limited square wave looks like after a set of transforms?

Yep! Some of the harmonics are just a little stronger relative to the fundamental but it looks fine. The thing I was worried about specifically was that the phases of the harmonics would be completely shifted all over the place. Check out this that I found on the web:



That's an all pass filtered square wave. All the components still have the same amplitude and it sounds the same. But the phases are scrambled so it no longer has the same visual shape. Nonlinear phase response can do this.


babyeatingpsychopath posted:

Also, is "shielded wire" a valid solution? Audio in airplanes often has runs of a few dozen feet, and it's in 2- or 3-conductor twisted shielded, with the shield only grounded at one end (usually at the audio panel). Even with LOTS of noisy motors and stuff around, there's typically not much audio hum in that system.

It may be, but I bet those 2 wires in the twisted pair carry balanced audio, otherwise it could just be 1 conductor plus a shield (right? guess I'll have to look into that). I'm also going to try out just a pre-amp and a resistive terminator and see if blowing a bunch of current through can reduce noise from induced currents. This isn't a microphone after all.

Stack Machine fucked around with this message at 20:51 on Oct 16, 2020

Ambrose Burnside
Aug 30, 2007

pensive
thanks for the radio tips, guys. I think I'll try to hang on to + restore the portable transistor radio and the oldest tube table radio; I had a vague idea of harvesting the losers of their old-school brick-shithouse-rugged switches and dials, but there isn't actually much there I could take, and they're all highly visible so doing so would destroy any vintage curio/decoration value. Maybe one of em has some value to collectors, who knows. Not a super high priority project for me right now anyhow, I didn't expect to acquire a shitload of radios until the Spirit Of The Auction overtook me.

kid sinister posted:

The real part that sucks to damage is the tuning capacitor. Now those are unobtainium.
ironically this is basically the only relevant component that I can confidently fabricate a replacement for to spec. as long as I can figure that specced range out, anyhow

kid sinister posted:

Hey Ambrose, there's one more piece of hardware that's handy to have with these old radios. It's an isolation transformer. A lot of the smaller 1940-1960 radios didn't have transformers in them. The nice thing about transformers is that they isolate return paths for electricity. You can't touch transformed hot and something else metal in the room and get a bad shock. In other words, transformers make it a lot harder for you to kill yourself by accident. Well, an isolation transformer is a transformer with a 1:1 turn ratio with a plug on one end and an outlet on the other. Whatever voltage you put in, you'll get out. That way, you can add the safety of a transformer to these old radios that don't have them while you're working.

this is also very good to know; I haven't done much with mains+ voltages except for some straightforward residential wiring during renovations so I'm not particularly keen on best practices beyond "you double-checked that the breaker's off? did you additionally put a sticky note with a sad face and then a skull-crossbones over the flipped breaker?"-100-level type stuff.
that plus the only-use-one-hand-at-once thing, anyways. multiple tradespeople/professionals have at various times emphasized it to me as The One Lesson You Legitimately Must Always Remember When Live Wiring's Afoot, and the people who said it were uniformly alive and not dead of electrocution, so they had to be on to something

kid sinister
Nov 16, 2002

Ambrose Burnside posted:

I had a vague idea of harvesting the losers of their old-school brick-shithouse-rugged switches and dials

Yeah... This isn't true. You're forgetting that they've had decades of use. The contacts are all worn out. The potentiometer wipers won't make contact throughout the range. The plastic is cracked. It's just not a good idea.

Ambrose Burnside posted:

ironically this is basically the only relevant component that I can confidently fabricate a replacement for to spec. as long as I can figure that specced range out, anyhow

Even when they have 2 or 3 gangs, can be turned with a dial string and have specialized mounting brackets that must line up with the hole in the face?

Ooh, one more tip. You can find LED replacements for a lot of the pilot lights from pinball suppliers.

Veni Vidi Ameche!
Nov 2, 2017

by Fluffdaddy

ante posted:

That's strange.


Arduino, PIO, and the Microsoft VSCode plugin are likely all generating exactly the same binary, I doubt that's the issue.


I use a lot of ESP32 stuff, and the way the dev boards are hooked up to the USB port, the reset line gets triggered when you initially open a COM port - It's possible something weird like that is happening, with the Arduino IDE handling the COM port a little bit differently.

I still don’t know what in the world was going on with the color issue. I did solve the other problem, though. There’s a wait loop in my code that doesn’t release execution flow until the serial port is ready. It’s been in there since the very beginning, and it exists in many of my Arduino projects. I have no idea why it suddenly became a problem when I switched to VSCode, but taking it out solved that particular issue. I wonder if I just always had the serial monitor open behind the other windows when I was using the Arduino IDE, and that was causing my loop condition to be satisfied.

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

Stack Machine posted:

I'm also going to try out just a pre-amp and a resistive terminator and see if blowing a bunch of current through can reduce noise from induced currents. This isn't a microphone after all.

I grabbed maybe 50 feet of cat 5 cable and sent some audio from my desktop to my laptop through it. It was... very bad. If I just plug it directly in without the tangle of cable draped across the floor, the noise floor is considerably lower (to the point that I can't hear it over a speaker, but the room isn't exactly quiet). The first thing I tried was just slapping a 100nF cap across the receiving end to get rid of AM radio, wi-fi, and other high frequency noise that might get rectified or something. It took the noise down quite a bit but gave me some roll-off in the high frequencies. I put an NPN follower on the sending side to buffer it a bit. It can drive the 100nF no problem but even with 50Ω of resistance in parallel with that on the receiving end, there is still some interference from local power supplies, and for some reason (probably the alligator clip leads to the follower on a solderless breadboard forming a giant loop) it picks up more 60Hz. I think I'll go ahead and build some little balun boards just to see if they improve this situation, and because I keep telling myself I'd love to build some audio circuits but I never actually build any.



In my screenshot here (log-scale waveforms) the top is the direct connection, the next is just straight through the twisted pair, then the cap, then the follower + cap + 50Ω. The sound being sent through is a 20-20000Hz sweep at fixed amplitude followed by silence. In some this is followed by the sending machine taking the line out high-impedance, which tellingly makes the follower quieter and the passive circuit louder.

cakesmith handyman
Jul 22, 2007

Pip-Pip old chap! Last one in is a rotten egg what what.

I don't know if you guys can help me but I'm failing at Google. I need a handful of these connectors to connect a cheap ebike controller to the kids ride on toy I built and I cannot figure out what they are called. Any suggestions?



I found the other plugs called 2.8mm 2 pin so those are sorted, but the battery and motor connectors are eluding me.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


cakesmith handyman posted:

I don't know if you guys can help me but I'm failing at Google. I need a handful of these connectors to connect a cheap ebike controller to the kids ride on toy I built and I cannot figure out what they are called. Any suggestions?



I found the other plugs called 2.8mm 2 pin so those are sorted, but the battery and motor connectors are eluding me.

Idunno either, but my motorcycle uses them for headlight connectors, so I went into my orders history and found this.

https://www.amazon.com/Lsgoodcare-Electrical-Automotive-Connector-Motorcycle/dp/B06Y2BJD5B

Sagebrush
Feb 26, 2012

Often when I have weird poo poo connectors like that on something that I care about, I will cut them off and replace them with an appropriately sized XT60 or Andersen power pole or something.

Hexyflexy
Sep 2, 2011

asymptotically approaching one

cakesmith handyman posted:

I found the other plugs called 2.8mm 2 pin so those are sorted, but the battery and motor connectors are eluding me.

Something like this?

https://www.ebay.com/itm/T-Type-2-Pin-DC-Power-Connector-Plug-For-VHF-UHF-Kenwood-Yaesu-Icom-Radio-Cable-/162826459803

cakesmith handyman
Jul 22, 2007

Pip-Pip old chap! Last one in is a rotten egg what what.

babyeatingpsychopath posted:

Idunno either, but my motorcycle uses them for headlight connectors, so I went into my orders history and found this.

https://www.amazon.com/Lsgoodcare-Electrical-Automotive-Connector-Motorcycle/dp/B06Y2BJD5B


Both of these help thank you, I found some now.

Sagebrush posted:

Often when I have weird poo poo connectors like that on something that I care about, I will cut them off and replace them with an appropriately sized XT60 or Andersen power pole or something.

Crimp on new spade terminals was always plan b as that's all I usually have handy.

Zero VGS
Aug 16, 2002
ASK ME ABOUT HOW HUMAN LIVES THAT MADE VIDEO GAME CONTROLLERS ARE WORTH MORE
Lipstick Apathy
I have three different automotive buck converters, a 36v-12v 40a, a 48-12 30a, and a 24-12v 30a. All three of them are readying 12.3v when I tap a multimeter to them with no load, which is way too high.

Does anyone have a recommendation for a load tester? I'm thinking I'd want to either invest in something adjustable, or just go to home depot and spend $2 on some filament 100w bulbs?

TacoHavoc
Dec 31, 2007
It's taco-y and havoc-y...at the same time!

Zero VGS posted:

I have three different automotive buck converters...All three of them are readying 12.3v when I tap a multimeter to them with no load, which is way too high.

Might be a dumb question, but what are you doing that would take an automotive converter, but not tolerate 12.3V on a 12V rail? That's like 2-3%, which generally speaking is well within typical (general use) supply tolerances. Put some kind of load on it and I'm sure it'll get even better.

Zero VGS
Aug 16, 2002
ASK ME ABOUT HOW HUMAN LIVES THAT MADE VIDEO GAME CONTROLLERS ARE WORTH MORE
Lipstick Apathy

cakesmith handyman posted:

I don't know if you guys can help me but I'm failing at Google. I need a handful of these connectors to connect a cheap ebike controller to the kids ride on toy I built and I cannot figure out what they are called. Any suggestions?



I found the other plugs called 2.8mm 2 pin so those are sorted, but the battery and motor connectors are eluding me.

While we're playing "name that obscure ebike connector", does anyone know if this Hulong plug is based off some kind of standard, or is it 100% proprietary?



The really bizarre thing is that the battery it goes to is 10-series (36v nominal, the official charger brings it up to 42v at 100% SOC so it's definitely 10s), yet there's only 8 balancing pins? How does that work? Maybe they have a cheaper version that is 7s and they used the same mold for this, with the balance pins being useless in this case?

TacoHavoc posted:

Might be a dumb question, but what are you doing that would take an automotive converter, but not tolerate 12.3V on a 12V rail? That's like 2-3%, which generally speaking is well within typical (general use) supply tolerances. Put some kind of load on it and I'm sure it'll get even better.

It's a page back but I'm trying to build a backpack VR PC. However I misunderstood the ATX specification; it specifies 120mv maximum ripple, which I took to mean that the voltage should only be within 120mv above or below 12.0 volts. Now that I'm double-checking, it actually states that the 12v rail can have bewteen 11.4-12.6 volts, so that's more forgiving that I realized.

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
I got my FPGA computer working. I output the bus to a logic analyzer and it matches exactly to the simulation.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

:toot:

Nice work!

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

Zero VGS posted:

I have three different automotive buck converters, a 36v-12v 40a, a 48-12 30a, and a 24-12v 30a. All three of them are readying 12.3v when I tap a multimeter to them with no load, which is way too high.

Does anyone have a recommendation for a load tester? I'm thinking I'd want to either invest in something adjustable, or just go to home depot and spend $2 on some filament 100w bulbs?

I think your regulation is probably fine; if this is intended to drive PC hardware everything that's downstream from it is just more bucks, and they'll tolerate a little slop in the 12V rail (ATX says +5%, so up to 12.6 is OK).

That said, dummy loads are a good idea and you can make a nice cheap-ish one out of 5W axial lead resistors, if you're down to solder. If you wanted to be fancy, you could get 128 of them and 7 switches (1 resistor on the first, 2 on the second, 4 on the third, ..., 64 on the last). The resistors would set you back about $60. This allows you to select any load from 0 to 46.5A in increments of 0.36A, and to easily switch in load steps and make sure the output doesn't overshoot like crazy.

However you arrange it your big pile of resistors will produce a lot of heat, so while it's tempting to pack the little square cross section resistor bodies all together in densely packed heap, the ones at the center will definitely get too hot. Think strip with gaps for airflow. If you want to arrange them in a grid, a PC fan or similar blowing over them would be nice.

If you aren't down for that much soldering, 120V incandescent bulbs are about 10 ohms cold, so you'd only get a little over an amp into each one. $1.50 of 5W resistors can do that and you can just twist the leads together, but you can't get them at the hardware store.

E:

Cojawfee posted:

I got my FPGA computer working. I output the bus to a logic analyzer and it matches exactly to the simulation.



This is awesome!

Stack Machine fucked around with this message at 02:56 on Oct 19, 2020

Veni Vidi Ameche!
Nov 2, 2017

by Fluffdaddy
Can someone help me understand the various iterations of the ESP32 and 32-S2? It looks to me like the 32-S2 is just a lower-power version of the 32 with a faster coprocessor and no Bluetooth. I see a lot of different boards based on those, but I can’t determine which, if any, are ready to go out-of-the-box.

I want a module that can be programmed over USB or USB->RS232 and is ready to go without me having to calculate capacitances for building my own antennas or whatever. I’m leaning toward the 32 because of Bluetooth, but I don’t want to order a module just to find out I didn’t understand what I was getting.

I still have a bunch of 8266s I can use, so this isn’t critical. I just want to play around with the newer versions.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Pick up an ESP32 dev board to play around with. They'll have the extra circuitry to allow USB programming.

When developing your own, the ESP32 modules come with their own antenna and are easy enough (with some gotchas) and program over serial. Also FCC certified, which is neat


The ESP32-S2 is newer and addresses some common complaints with the older stuff, but I wouldn't worry about it until you also have those complaints. The code / framework is slightly different, and with it being newer, it's less well supported.

Veni Vidi Ameche!
Nov 2, 2017

by Fluffdaddy

ante posted:

Pick up an ESP32 dev board to play around with. They'll have the extra circuitry to allow USB programming.

The problem I’m having is that there is a huge number of “dev boards” available for the ESP32, and you have to dig around not only in the data sheets, but also in the seller listings, because they seem to be frequently mislabeled.

I ended up grabbing a couple of ESP-32Ds from Amazon. They seem to be what I want.

I am going to eventually incorporate network/Bluetooth/app control into the clock project I’m working on.


00:00:00


08:16:32


14:24:44


22:54:54

Wow. Those photos already looked like garbage, but Imgur hosed them over extra. This video showing the pulse pixel in operation seems to be even worse.



Edit: Oh, by the way, I did manage to implement a working level-shifter. A couple, actually. Then I threw them away and put in a CD4504BE, because once I had proven to myself that I could build one that worked, there was no point having a bunch of extra components and wires sticking out everywhere when I could have a tidy little IC for like $.40.

Veni Vidi Ameche! fucked around with this message at 23:30 on Oct 19, 2020

Dominoes
Sep 20, 2007

Do y'all have any tricks for keeping a serial-over-USB connection alive? If all the MCU program does in the main loop is poll the serial connection, things work as expected. If I add other things to the loop (Like the main program), the connection drops almost immediately. (Windows device manager won't show it.) If I do about 10k polls before the main loop, WIndows still keeps the device, but programs on the PC can't connect to the serial port.

I'm about to do a more thorough test of where the process is breaking. It appears that even a delay on the order of seconds will kill the serial connection. Haven't tested if interrupts will. This kind of goes back to my initial questions about serial communications, and most examples I find are of these trivial poll loops.

Specifics: Device takes sensor readings periodically; displays them; has menus etc. Can also send readings, on request, to a PC. Executing the former breaks the latter by messing up the PC's ability to see the COM port.

Spatial
Nov 15, 2007

A USB device which doesn't respond for seconds at a time is going to cause quite a lot of problems. It probably has nothing specifically to do with acting as a COM port.

When you say are polling the serial connection, I'm guessing you're calling into a driver which actually does a lot of things like handling enumeration and servicing the USB peripheral in general. That's often how code like that is generated. Practically you likely need to invoke that servicing through a timer callback on a regular interval like every 10ms, seperate from regular program flow.

Dominoes
Sep 20, 2007

Would I need to handle this with threads, RTOS etc? Essentially, what I'm attempting is: PC sends a repeated signal indicating it wants a reading. Signal repeats for a few seconds, then gives up. MCU listens for this signal once every second or so, and if it receives it, it responds to data.

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

Dominoes posted:

Would I need to handle this with threads, RTOS etc? Essentially, what I'm attempting is: PC sends a repeated signal indicating it wants a reading. Signal repeats for a few seconds, then gives up. MCU listens for this signal once every second or so, and if it receives it, it responds to data.

You wouldn't strictly need threads or an RTOS to do this. You can do it with timers as long as your core loop is kept sufficiently short.

The basic idea is that you have a main loop that just checks against the main clock to see if it's time to execute action [x] for all the relevant actions (poll a sensor, compute something, send a packet, etc.). Then you can set independent intervals for each of those actions, and the program won't waste time executing actions unless it's needed.

Key to this implementation is that you shouldn't ever wait for a response. While loops are a bad idea. Instead, you'll want to send the poll command to the device, then drop back to the main loop and check for a response as one of your actions.

This all feels very abstract and vague the way I'm describing it, but actual implementation would get really down in the weeds. Let me know if it doesn't make sense in a way I can elaborate on.

Shame Boy
Mar 2, 2010

KnifeWrench posted:

You wouldn't strictly need threads or an RTOS to do this. You can do it with timers as long as your core loop is kept sufficiently short.

The basic idea is that you have a main loop that just checks against the main clock to see if it's time to execute action [x] for all the relevant actions (poll a sensor, compute something, send a packet, etc.). Then you can set independent intervals for each of those actions, and the program won't waste time executing actions unless it's needed.

Key to this implementation is that you shouldn't ever wait for a response. While loops are a bad idea. Instead, you'll want to send the poll command to the device, then drop back to the main loop and check for a response as one of your actions.

This all feels very abstract and vague the way I'm describing it, but actual implementation would get really down in the weeds. Let me know if it doesn't make sense in a way I can elaborate on.

I do a lot of my programs like this, and basically you just have a "task" abstraction (class, whatever your language supports) that has "hasWork()" and "doWork()" functions. The main loop goes through each task and calls "hasWork()" which returns true if it's got stuff to do do (internally indicated by setting a boolean flag via an interrupt, timer expiring, whatever), if it does the main loop calls "doWork()", if it doesn't it skips it. You write each doWork() function to never block and wait for things, but instead you either use a timer/interrupt or just have it set hasWork() each loop so it checks each time without blocking anything else.

The main function then just looks something like this

code:
main() {

    doGeneralSetupStuff();

    while(true) {
        for each task in taskList {
            if (task.hasWork()) {
                task.doWork();
            }
        }
    }
}

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Shame Boy posted:

I do a lot of my programs like this, and basically you just have a "task" abstraction (class, whatever your language supports) that has "hasWork()" and "doWork()" functions. The main loop goes through each task and calls "hasWork()" which returns true if it's got stuff to do do (internally indicated by setting a boolean flag via an interrupt, timer expiring, whatever), if it does the main loop calls "doWork()", if it doesn't it skips it. You write each doWork() function to never block and wait for things, but instead you either use a timer/interrupt or just have it set hasWork() each loop so it checks each time without blocking anything else.

The main function then just looks something like this

code:
main() {

    doGeneralSetupStuff();

    while(true) {
        for each task in taskList {
            if (task.hasWork()) {
                task.doWork();
            }
        }
    }
}

This is what all of my arduino sketches look like.


For my question:

I've got a TLV760 . I can't get it to run. How vitally important are the input and output capacitors? I forgot to hook up the input capacitor in this board version. Would just that cause it not to start at all? I thought it was a linear regulator. I'm feeding it 13.8VDC @ 100mA current-limited, trying to get 12.0VDC @ 20mA to power a little part. I measure 13.8VDC on the input, 0VDC on the ground, and nothing on the output. There's a .1uF X7R on the output, and a .1uF X7R on the upstream side of my reverse polarity diode array.

Dominoes
Sep 20, 2007

Thank you! Going to experiment with this and try to understand.

Let's say, for one of the readings, a sample and hold circuit is running for 1/4s or so. How would you keep the USB ms-order polling requirement alive?

I tried setting up a thing so if you push a button, it stops the main work, and goes into a pure USB polling loop. This only works if I hold the button at the time the device is being powered on. It seems like if it fails to poll even once, it never gets it back until you re plug the device into the PC. Maybe there's a way to re-initialize the USB on the PC side? (This would allow changing application state between normal function, and as USB device; not ideal, but acceptable)

Maybe a separate MCU dedicated to USB polling? Or RTOS/RTIC?

TacoHavoc
Dec 31, 2007
It's taco-y and havoc-y...at the same time!

Dominoes posted:

Let's say, for one of the readings, a sample and hold circuit is running for 1/4s or so. How would you keep the USB ms-order polling requirement alive?


If you're waiting a quarter second for anything on a microcontroller, that's not going to work. In uC land, something like that would be triggered, then you'd go off and handle other tasks, then you'd return to get your reading once the hardware interrupt fired or your scheduler flag was raised, depending how you're controlling program flow.

Spatial
Nov 15, 2007

All you need is to run the USB routine in an interrupt from a timer.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Just use a USB-serial chip.

I get that it's not as clean as a built in solution, but my god is it easy, quick, and inexpensive

Dominoes
Sep 20, 2007

I think the USB serial chip might be the answer. The readings delays I have might be removable, but the display I'm using takes some time to refresh, and is well out of the ms range.

edit: Unless I can get

quote:

All you need is to run the USB routine in an interrupt from a timer.
working, which I'm attempting now.

Dominoes fucked around with this message at 21:56 on Oct 20, 2020

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

You can do all kinds of other things while you are waiting mS for the display

csammis
Aug 26, 2003

Mental Institution

ante posted:

Just use a USB-serial chip.

I get that it's not as clean as a built in solution, but my god is it easy, quick, and inexpensive

And you can get them really small if that's a concern, like the CH340E in an MSOP-10 footprint. $0.59 in single quantities from LCSC.

"Clean" is in the eye of the beholder as well. I know for my personal projects I couldn't be bothered to place, route, write software for, and debug a dedicated USB device just for the purpose of chatting with a host PC. One tiny chip that handles the communication for me is loving beautiful.

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin
Even if you work around it with different chips or interrupts, you will still benefit greatly from learning not to wait hundreds of milliseconds for a response from a peripheral.

My $0.02

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

babyeatingpsychopath posted:

I've got a TLV760 . I can't get it to run. How vitally important are the input and output capacitors? I forgot to hook up the input capacitor in this board version. Would just that cause it not to start at all? I thought it was a linear regulator. I'm feeding it 13.8VDC @ 100mA current-limited, trying to get 12.0VDC @ 20mA to power a little part. I measure 13.8VDC on the input, 0VDC on the ground, and nothing on the output. There's a .1uF X7R on the output, and a .1uF X7R on the upstream side of my reverse polarity diode array.

The input capacitance is important in the sense that it keeps parasitic inductance and resistance from under/overvolting the input in response to load changes. It may be that it's failing to start because of this. That said, unless you're on a long cable, I'd check the circuit downstream from the regulator first. If you disconnect the supply and drive 12V on the output side of the regulator (this is not likely to damage the regulator), does that circuitry come up OK? If that's all working, you can add an input cap just by soldering one in on top of the regulator, if you have one handy.

Kreeblah
May 17, 2004

INSERT QUACK TO CONTINUE


Taco Defender

Kreeblah posted:

Regenerating the Gerber files from scratch didn't help. I was able to get in touch with them, though, and they confirmed it was an error with their Gerber viewer, and that they'll make sure the boards are manufactured correctly.

Edit: They sent me the production files prior to putting them in for manufacturing, and the board does look right on those, so I think I'm good. They also quoted me less for the parts to get them from DigiKey than I'd pay to get them myself, which was neat. I didn't expect to be able to benefit from their volume discounts.

Alright, after one revision because I'd botched the USB connector footprint (oops), I have some boards in hand which, theoretically, work. I think I just need to work through some software issues at this point. I almost wonder whether it's not using the clock crystal or something.

The hex file I'm flashing to this was originally intended for a Teensy 2, which I've tried to replicate the essential parts of for what I'm doing. And, it sort of works. I don't have the Halfkay bootloader, obviously, so I used an ISP to flash the hex to the AVR, and it started running that way. However, I'm not sure it's doing much other than just blinking. I don't see it enumerated in the USB device list when I connect it the board USB, and the LED blink pattern doesn't change when it has a joystick connected, which it's supposed to.

To check out the USB part, I compiled the LUFA CDC bootloader and flashed it. That actually does show up in the USB device list afterwards, and I can use it to flash this hex file to the board, which then exhibits the same behavior as when the hex is flashed via an ISP. That at least tells me that the USB connection is usable, not just for power, but for data as well.

So, does a software issue seem like a likely place for me to start with looking into this, or am I overlooking some other possibilities?

Kreeblah fucked around with this message at 22:54 on Oct 20, 2020

Adbot
ADBOT LOVES YOU

Foxfire_
Nov 8, 2010

Stupid question: Does the blinky light program actually try to do anything with the USB or is the USB device you saw before the (now gone) bootloader program running the USB peripherals?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply