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.
 
  • Locked thread
longview
Dec 25, 2006

heh.
zynq is good, xilinx SDK is not that good

awful API documentation and afaik you have to use vivado to configure what peripherals are in use and to set pin mappings on the processor which is nice for portability between boards but also really annoying if the FPGA dev is on vacation and he made even a tiny mistake in the hardware definition

Adbot
ADBOT LOVES YOU

longview
Dec 25, 2006

heh.

JawnV6 posted:

root caused to his test loop, he'd written it as
code:
i++;
if(i%5==0)
     send_sample();
that % op was taking significantly more time than collecting the sample or UART, so instead of 1/5th the sample rate it was 1/100 or so

i remember a couple of years ago trying to implement a uint16->decimal conversion function for displaying a value on an LCD on a PIC16

iirc for 10-bit ADC values it was around 10x faster to just subtract 1000s, 100s etc. down to 0 than doing even a single modulo operation

longview
Dec 25, 2006

heh.
i usually just pop in a 1-10µF 0603 ceramic unless the data sheet is very specific about what is needed

longview
Dec 25, 2006

heh.

Poopernickel posted:

decoupling is actually a super-complicated topic - more uFs (uF uF uF) aren't always better

remember: it's not the size of the capacitor, it's how you gently caress

I'd plop down a 0.1uF in the smallest package you're comfortable with, right next to each power pin. if you need ~precise~ measurements, maybe add a 1uF and an 0.01uF in parallel

it is complicated when you're driving high speed FPGAs that don't have internal decoupling or you have a ton of high speed unbalanced digital I/O to consider

of course for those caps to have any effect you'd need a power+ground plane on the board to match, and if you're dead bugging an IC on a prototyping board the wires between the board and IC will add so much inductance that the sick gains from using a beautifully calculated broad band 0402 or 0201 packaged decoupling network with power plane capacitance will be completely irrelevant

and there's two sides of the same issue here; one aspect is making sure there's a PDN with a low enough impedance at all frequencies the devices under load needs to operate and drive I/O without di/dt related voltage drops, the other is making sure the incoming power supply doesn't have a bunch of switching noise from other devices on the same rail

for a gyroscope the output is probably analog or some slow interface like I2C/SPI and it might make more sense to put a dedicated linear regulator + some series resistance/inductance near it, along with whatever decoupling the device + regulator needs

longview
Dec 25, 2006

heh.
what is a good ide to use with STM32 mcus?

arduino due is a very comfortable environment but i can't ignore how ridiculously cheap the stm32f103c8 is so i ordered some eval boards and a cheap programmer in case the UART bootloader doesn't work

longview
Dec 25, 2006

heh.
Alright, I'll give Eclipse + extensions a try, thanks guys.
though i might also see if the stm32 arduino port works at all, mostly depends on how much work it is to set up a graphics library with the normal ARM libraries.

for my eval board i just ordered some of these: https://www.aliexpress.com/item/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-Arduino/32279776568.html
really basic stuff that i should be able to put on a bread board to get the feel for the platform.

i'm planning on rolling my own board initially to convert some old panasonic car-phones into 430 MHz ham radios, i need to drive an OLED display and maybe do a bit of tone generation with PWM so not doing anything really special. if it wasn't for the OLED display i could probably fit most of the functionality in an atmega328 or two.

but if i can get it running without too many tears i'll probably use the chip for lots of other things since it's so nice to have enough ram to buffer at least an entire 128x64 mono display + be able to use floating point where needed without taking several ms per calculation

longview
Dec 25, 2006

heh.
some old designs used ROMs as gate arrays/lookup tables so if all you find is ROMs + standard logic that might be what they're doing

longview
Dec 25, 2006

heh.

DuckConference posted:

the dev kit for the chip didn't terminate their sdram bus so we figured it would be fine to not to terminate ours

the ringing is past the absolute max limits for the pin voltages

that must have been a weird rear end dev board.
but you could get away with it for the CA bus if you had series terminations for a single chip design (at least for DDR3).

-

i got my stm32 boards that i asked about here a while back. took a couple of weeks before i could use them since i foolishly ordered an st-link to use with my st micros, but then i'd have had to use openocd for debugging which is apparently crap.

so i ordered a knockoff j-link v8, then had to do the old erase flash-reset-SAM bootloader-update dance to get a newer firmware into it, then update with the j-link software.

but then the most amazing thing happened:
i had installed the arm-eclipse project setup, made a new example project, selected my chip, changed the led blinky pin to the correct one for my board, made a debug profile with all defaults, and hit the debug button

and it worked!

gotta say the arm-eclipse folks have done a very good job with their documentation, i followed their instructions to the letter and everything works including debugging, named register views (something i never got to work in AVRs), breakpoints etc etc. worked on the first attempt.

haven't figured out how to get the trace output over the SWDIO pin yet (might have to just hook up the SWO pin?)

longview
Dec 25, 2006

heh.
put in a GPS receiver and use the PPS signal to calibrate the clock, easy and no crystal required!

longview
Dec 25, 2006

heh.
i think the big deal with high speed i2c is you need a lower input threshold. might need a stronger pulldown transistor as well.

the pcf8574 is 100 khz only for example but it works at 400 khz as long as the bus capacitance is low enough/pullups are strong enough

longview
Dec 25, 2006

heh.
6n137 is real good at common mode noise rejection for higher speed signals

Ground the input side to the ignition section and the output to the digital side, don't bridge them

longview
Dec 25, 2006

heh.
d1 will prevent the RC circuit from discharging back to the ignition circuitry so your positive going time constant will be roughly r1*c1 while the discharge will be r2 (+ the diode nonlinearity)*c1

you'll probably want to remove D1 since you're interested in the falling edge

you might considering moving D2 to in parallel with C1; depends on how much energy is actually in the spike. if it's a lot then D2 might get pretty warm, using a series resistor will at least limit the dissipated power but the resistor might have to be fairly beefy to handle it...

if you leave it at the input then i'd suggest a fuse in case it fails

figuring out the effect of the diode on the filter is probably simplest to just simulate; i think figure 20 in the data sheet shows pretty clearly that you need 2-3mA to trigger the output. remember that you need a pullup on the 6N137 output in addition to the supply/enable pins.

here's another approach if you have a moderately fast high voltage diode like a HS1M, 1n4007 might be fast enough too


seems like you only have a couple of fairly fast spikes going below 14V, so if you size R1*C1 for an appropriate time constant and ensure it'll pull properly low against Rpu then it might work pretty well

a small cap to ground between R1 and D2 might also help reduce the peak reverse voltage it has to endure

longview
Dec 25, 2006

heh.
debouncing is usually just a simple filter that requires an input to stay in the same state for a given time before its output changes, kind of like a digital hysteresis

in this case those narrow glitches could be debounced since they're significantly higher frequency than the signal of interest, but analog filtering would also work.

if it's going into e.g. a MCU HW timer clock input or interrupt then debouncing in software might be a little annoying

sagebrush: if you go with my second suggestion you could probably skip the optocoupler since the input impedance will be pretty high. use a comparator with an appropriate hysteresis to get a nice clean output.

another fun way to do it would be capactive/inductive sensing; but probably not necessary in this case.

longview
Dec 25, 2006

heh.
1) just get a unidirectional TVS

2) yeah it would reduce the diode current, i don't know the details of motorcycle ignition systems but you should be sure that killing the high voltage spike won't cause issues with the circuit operation
in addition, whenever the TVS conducts it'll conduct high frequency current which is usually bad for noise

one thing i worked out pretty quickly designing power input stages for extremely noisy power sources (i.e. 10V+ p-p noise across a wide frequency range) and surge protection circuity is it's often better and easier to reflect noise rather than absorb it as long as you don't need a lot of power
probably worth thinking about for whatever power supply circuity you need for this; sticking a big capacitor right across the input with no series impedance to the rest of the supply will put that capacitor in parallel with the rest of the vehicles power bus.
a cheap trick is to put a fast half-wave rectifier on DC power inputs, as long as you can handle the peak input voltage then it saves you from handling any ripple current other than what your load is using.
ps: 1n400x and 1n540x are banned from any circuit involving frequencies higher than 60 Hz, they are atrociously slow. 1n4148 is pretty good.

4) that's correct
thinking more about as mentioned in a previous post, with a high impedance input there shouldn't be much noise coupling really and a comparator might be more appropriate and easier to work with:

hysteresis will also provide some extra noise immunity.

some considerations:
D2 has a leakage capacitance; C1 should be significantly larger than the capacitance of D2 to avoid noise (with the values you outlined before it's probably not a problem)
D4 is probably optional, but can be nice to have there to reduce the voltage over D2
R6 is also optional, in case of a severe transient on the input with a small C1 then D1/D3 might actually conduct; but that might also cause the input protection in U1 to conduct due to the forward voltage of D1/D3 probably being slightly higher than the protection in U1.
R6 limits the current in that case and has no real effect on circuit operation otherwise as long as R6 is below ~47k-1M depending on the type of comparator (bipolar, FET, CMOS etc.)
the part number for U1 was picked at random

the time constants will need tuning, the charge time constant will need to charge up to above the threshold of U1 during the on-cycle, while the discharge constant should be slow enough to not trigger for the shorter falling edges while being fast enough to discharge during the off-time for the highest RPMs you can get.

hysteresis of the comparator might be easier just to ballpark and put in a trimmer to tune it once it's installed.

longview
Dec 25, 2006

heh.
in the schematic software pin 1 is on top so it looks neater to put a supply voltage there

for my own boards i always ground the last pin on SIL headers and put a ground symbol in the silk next to the pin

longview
Dec 25, 2006

heh.
even proer if you can be bothered to get out the 0.1" pin ground lead clip that comes with most pro scope probes

but then you can only get one probe per pin instead of a haphazard stack of alligator clips, just can't win

also helpful to put a 2 pin header to bridge split ground/isolated inputs

and to avoid making 1000 :10bux: mistakes, always put series resistors on voltage test headers. especially if there are multiple supplies on adjacent pins

longview
Dec 25, 2006

heh.
Have you checked the phone jack switch? The speaker out is switched through that so if it's corroded then it won't work.

longview
Dec 25, 2006

heh.
ok not too familiar with old apples but looks like SPRK_H going into Q5 is the buzzer which rules out UK11 and UK10 as faulty.

check the output of the differential-single ended converter (J25:3 might be a good test point), then you'll have to follow the signal path

not too many electrolytics in the signal path other than the ones shared with the buzzer, signal path should be pretty simple to follow as long as you can find the op amps.

longview
Dec 25, 2006

heh.
looks like they stuffed all the passives on the bottom layer, wonder if they wave soldered the bottom layer (if so there's usually traces of red glue around all SMD components on that side).

based on recent experience my guess would be a cracked resistor

will need to find UL11 or get to the bottom layer to check that though. you've already ruled out all of the DAC + UL12 which is good.

longview
Dec 25, 2006

heh.
i don't think my workplace can even blink a LED let alone PWM it without a $200+ FPGA

but then that's what happens when you have a ton of FPGA devs on staff

hobbesmaster posted:

have you tried fram

we use cypress I2C fram in a work project since it's got fast and infinite writes. good for storing things like circular log buffers.

longview
Dec 25, 2006

heh.
one way of improving the life time of eeproms in applications like that is to allocate a larger memory area and increment the address on each write.
i still agree that a more resiliant storage form is better though, fram is somewhat expensive compared to equivalent size eeproms but not ridiculously so.

also note cypress frams lose their data after about 10 years if you store them at too high a temperature, down from nearly infinite to 10 years.

longview
Dec 25, 2006

heh.
have you tried wrapping a few turns of wire around the coil and picking it up inductively? or maybe just making a simple current transformer on the coil return line

it might actually be a cleaner signal, isolated, and less worry about affecting circuit operation (it will obviously still tap some energy from the inductor, but maybe a very small amount)

capactively coupling it by just putting an electrode near the coil output would also work, but might be more sensitive to interference than an inductive pickup.

longview
Dec 25, 2006

heh.
congratulations sagebrush, i've never tried doing the whole import waveform into ltspice and simulate thing. might have to do find an excuse now!

hifi posted:

drat i never had any of that

do people poo poo on the dinky handheld lcr meters like they do with transistor testers

i never got why transistor testers get so much poo poo, back when they were common it was also fairly common to have to match transistors when replacing parts....

but what i'd expect to be missing in more affordable LCR meters:
* shielding provisions, unlikely to come with shielded leads
* 4-wire sensing
* higher test frequencies
* may not tell you ESR

cheaper meters usually won't do measurements on very small (sub nF or uH) components with any kind of accuracy or repeatability since there's so much stray reactance in the leads.
they also tend to only use up to 1 kHz test frequency to measure while higher end models will do 100 kHz (super fancy ones will do 10 MHz, basically they turn into beautiful vector network analyzers if you throw enough money at them)

in particular it's hard to measure small inductors with cheap meters

i use a set of Smart Tweezers ST5S, they're pretty good

longview
Dec 25, 2006

heh.
i never checked it out but i've suspected it follows a constant energy curve for the more ridiculous C-V combinations (like my favourite 10µF 50V 1210 capacitor, drops down to nothing before 20V)

i built a RIAA using ceramic capacitors in the low level filter section last year, as expected it also works a microphone. i just screwed it into my rack setup so it doesn't vibrate enough to cause audible noise.

"100nF 50V 0603" is still better than "1µH inductor, 1210" as a part specification

longview
Dec 25, 2006

heh.
my RIAA was mostly built with low value ceramics (C0G dielectric characteristic), AFAIK all ceramics are microphonic to varying degrees

film capacitors are pretty good, but they're also huge compared to ceramics or electrolytics

the piezoelectric effect + probably the C-V effect is why most high end audio circuitry uses film capacitors for AC coupling

they're also fairly common in AC line filters or things like class D amplifier output filters, i think power dissipation requirements are a big deal when choosing them there. a decent film capacitor for filtering will have specific ratings for maximum AC voltage across frequency.

tantalums are generally pretty good as local decoupling but forget about using them for line filters since they're probably the most fragile kind of capacitor in common use

longview
Dec 25, 2006

heh.
that's pretty terrible, but you gotta admire that dedication to saving $0.001 by not putting in an extra resistor to make it work

it's not like a SN74LVC2T45 is that expensive

longview
Dec 25, 2006

heh.
the current limit is kind of there anyway for HC logic since the output drive transistors are physically tiny and so the on resistance is very large

different logic families have different maximum currents, HC logic is only actually good up to 4mA so they can't really drive a LED at full current (and will probably drive a LED directly since the output transistors are real wimps).

LVC/LCX logic is much faster and can drive more current (up to 32mA depending on supply voltage). TTL logic is even shittier and usually they have asymmetric output impedances with terrible sourcing capabilities.

this is part of why i use a pleasing shade of orange for all my LEDs unless absolutely necessary; they light up sufficiently for office environments at less than 1mA.

Adbot
ADBOT LOVES YOU

longview
Dec 25, 2006

heh.
ADS1115 is a pretty ok cheap 16-bit 4 channel I2C ADC that you can buy as a little PCB on eBay, 16-bit with 4 channels and a PGA.

for a really precise application you might want something like the ultra fancy 24+ bit delta-sigma converters that TI/Analog/Linear make for this sort of application. IIRC they also come with 50/60 Hz notch filters as a selectable option.

  • Locked thread