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
Bloody
Mar 3, 2013

i would do it ~on the metal~ but thats because i dont know poo poo about operating systems (other than that theyire poses)

Adbot
ADBOT LOVES YOU

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
freertos was ok for the product i used it in. it certainly has some flaws but at the end of the day it does what it says on the tin: it gives you a task scheduler, queues and some concurrency primitives and has a reasonable memory footprint. the source is kind of gross but it won't keep you from getting your work done. if you've got some logical concurrency in your application go for it, if you don't need that don't bother and just stick with a superloop or state machine or interrupts or whatever you were doing imo

Sapozhnik
Jan 2, 2005

Nap Ghost

longview posted:

should i use something like freetros for my next project or just do what i always do and write ad hoc routines and a ten page exception handler?

it's mostly just shifting serial data around, maybe some DMA, sleep and a ton of scheduled monitoring tasks

Write a linked-list library, then create a linked list of function pointers protected by nestable IRQ enable/disable commands.

There's your operating system. Superloops are kinda lovely to work with ime for all but the most trivial firmware projects. If you have some nontrivial reliability requirements then buying an RTOS license might be worth your while though.

If you're going to go completely ham with overlapping DMA then it might be worth pulling in a "real" embedded OS just so you can have a context-switching scheduler, continuation passing style in C is not very fun.

a cyberpunk goose
May 21, 2007

Mr Dog posted:

Write a linked-list library, then create a linked list of function pointers protected by nestable IRQ enable/disable commands.

There's your operating system. Superloops are kinda lovely to work with ime for all but the most trivial firmware projects. If you have some nontrivial reliability requirements then buying an RTOS license might be worth your while though.

If you're going to go completely ham with overlapping DMA then it might be worth pulling in a "real" embedded OS just so you can have a context-switching scheduler, continuation passing style in C is not very fun.

the last year of my life at my old job in a nutshell

the CEO's brilliant solution???

micro python (https://micropython.org/), using the generator pattern as a tasking system so that we can keep state without writing gnarly code

yes sir i was paid to make this poo poo run on a k64 and start hooking up bindings

yes i want to die

longview
Dec 25, 2006

heh.
i should probably clarify that the serial data is 4800 baud and the DMA would just be for a laugh, with ~20 mips of pure integer processing power I can bit bang this no problem but i don't want to
i might still give freertos a try to see what it's like but i can definitely write this in standard C and a couple of state machines + a set of timed interrupts to handle maintenance tasks like self testing, monitoring battery status etc.

new question i guess: my serial data is synchronous, the radio interfaces handle clock recovery and sync, but i need to receive some data from a sound card (ASK) interface with no clock
UART is a no go since it's a bit-stream with no byte boundaries that it can detect

i know the baud rate, so i was thinking i'd run it to a SPI input in master mode and use 4x (or more) oversampling to resolve ambiguity when the clock edges drift together (only one bit out of four is likely to be clobbered by sampling on a transition so majority rule)

the other obvious option is to hook the input to an interrupt in the MCU and use a timer to count the on/off times and calculate each bit that way

SPI mode might be less work, and fits my hardware architecture, but i do have remappable pins so it should be possible reconfigure the pins on the fly

obviously i could also find some modem IC or add hardware to do clock recovery, but i don't want to spend too much money on this feature

E: or I could just emulate a commercial products serial interface and drop the ASK, that might be easier for everyone

longview fucked around with this message at 11:58 on Dec 13, 2014

a cyberpunk goose
May 21, 2007

longview posted:

i should probably clarify that the serial data is 4800 baud and the DMA would just be for a laugh, with ~20 mips of pure integer processing power I can bit bang this no problem but i don't want to
i might still give freertos a try to see what it's like but i can definitely write this in standard C and a couple of state machines + a set of timed interrupts to handle maintenance tasks like self testing, monitoring battery status etc.

new question i guess: my serial data is synchronous, the radio interfaces handle clock recovery and sync, but i need to receive some data from a sound card (ASK) interface with no clock
UART is a no go since it's a bit-stream with no byte boundaries that it can detect

i know the baud rate, so i was thinking i'd run it to a SPI input in master mode and use 4x (or more) oversampling to resolve ambiguity when the clock edges drift together (only one bit out of four is likely to be clobbered by sampling on a transition so majority rule)

the other obvious option is to hook the input to an interrupt in the MCU and use a timer to count the on/off times and calculate each bit that way

SPI mode might be less work, and fits my hardware architecture, but i do have remappable pins so it should be possible reconfigure the pins on the fly

obviously i could also find some modem IC or add hardware to do clock recovery, but i don't want to spend too much money on this feature

E: or I could just emulate a commercial products serial interface and drop the ASK, that might be easier for everyone

repurposing SPI is a fun and attractive thing to at least try

yippee cahier
Mar 28, 2005

Blotto Skorzany posted:

i had wondered for a while why the stack overflow checks in freertos never seemed to work (always reported that no overflow had occurred) and the mpu exception handler that i wrote always got called instead. i was poking around in the scheduler for other reasons and found this

code:
		//taskFIRST_CHECK_FOR_STACK_OVERFLOW();
		//taskSECOND_CHECK_FOR_STACK_OVERFLOW();
i guess that's why setting configCHECK_FOR_STACK_OVERFLOW to the appropriate value didn't do anything. i'll have to check git to see whether a coworker did this or if the main distribution had this bug at the time we grabbed it.

Haha, I would lose it if someone checked this into the project I work on.

Sagebrush
Feb 26, 2012

wondering if maybe one of you expert bit janitors can tell me what's wrong with my hall effect sensor

it's a honeywell ss411 type hooked up to an arduino (lol) with nothing more in the circuit than the power, ground and signal wires. when powered, the sensor's output slowly pulses up and down at about 0.5hz. the difference between the peaks and valleys here is about 50mV.



the chopped up section at the end is me passing a magnet back and forth in front of the sensor. the magnet reliably drops the output to ground, but as you can see the pulsing continues in the "background".

this happens with two different arduino boards, on two different computers, with two different sensors. i am like 99% sure that the output should be constant.

what happen

Sagebrush
Feb 26, 2012

I have discovered that decreasing the delay between samples results in a noisy but reasonably stable output.



this delay affects both the rate that the ADC is sampled and the rate at which the data is sent back to the computer. In the first one it was 10hz and in this new graph it's 100hz. what the hell is happening and why

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast
hey idk poo poo about electronics but maybe it operates with some internal capacitance that gets charged and self-discharges till it charges again unless in presence of the magnetism, which opens/closes/w/e the ckt?

Sagebrush
Feb 26, 2012

i thought about that, but if whatever_circuit isn't charging when the magnet is in front, shouldn't the first graph be distorted so that it sort of picks up where it left off when i remove the magnet? as it is, the cycling is independent of the magnet position

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast
idk but whatever it is the noise floor you've shown is still well high enough to measure against and throw out the spikes entirely

or smooth them out if it matters for your circuit i guess idk

Sagebrush
Feb 26, 2012

yeah the latter data is usable, i think, but i still want to know why it's happening!

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast
maybe the arduino's ADC is poo poo then idk

Sagebrush
Feb 26, 2012

lol i'm a dumbass. i put it on the oscilloscope totally out of the circuit and got the same weirdness and was like "WHY DOES THIS KEEP HAPPENING" then suddenly realized it's an open collector device, not something that is supposed to output a specific voltage level. stuck a 10k between the output and Vcc and now it works perfectly. herp derp

s'cool that the serial port and/or more likely the sampling rate of the adc can have that much of an effect on the residual charge or whatever it was measuring, though

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
any suggestions on what level of scope I'd want for hacking on old-computer projects, with things like 25 MHz CPUs and 10 MHz busses?

like, is a dirt-cheap modern scope fine? how about a used 100 MHz scope? is that overkill?

would I be better off with a logic analyzer? saw an HP 1660 with kit for what looked like a decent price yesterday…

Bloody
Mar 3, 2013

yeah a 100MHz scope would be solid for that. make sure your probes don't have shitass bandwidth though; that's what's been biting me lately (albeit at higher frequencies - 50 MHz signals into 100 MHz probes on a 500 MHz scope look like rear end). various forms of logic analyzers and things like that are nice but not as mandatory as just a working scope imo

longview
Dec 25, 2006

heh.
the saleae Logic series is pretty nice for slowish logic, the new ones are mixed signal too, not a scope replacement but a nice supplement if you're troubleshooting timing and logic problems instead of signal integrity issues

Bloody
Mar 3, 2013

longview posted:

the saleae Logic series is pretty nice for slowish logic, the new ones are mixed signal too, not a scope replacement but a nice supplement if you're troubleshooting timing and logic problems instead of signal integrity issues

dang their highest end model looks fuckin sweet

Sagebrush
Feb 26, 2012

is the EEVblog guy on youtube good or is he a wacko? I watched some of his reviews of oscilloscopes and he seems to know what he's talking about, but he also sounds like he's just about to go off the rails, and I can't tell if he actually is or if it's just, his, infuriating, breathy, australian, ACCENT???

and some of the stuff i don't know how much stock to put in. like when he says multimeters that use glass fuses are "unsafe garbage", i'd never heard that before. maybe for a lineman sure but for a hobbyist poking at lvdc?

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

Sagebrush posted:

is the EEVblog guy on youtube good or is he a wacko? I watched some of his reviews of oscilloscopes and he seems to know what he's talking about, but he also sounds like he's just about to go off the rails, and I can't tell if he actually is or if it's just, his, infuriating, breathy, australian, ACCENT???

and some of the stuff i don't know how much stock to put in. like when he says multimeters that use glass fuses are "unsafe garbage", i'd never heard that before. maybe for a lineman sure but for a hobbyist poking at lvdc?

the problem isn't poking at LVDC, it's accidentally hitting HVDC. glass fuses are bad esp when in a multimeter that might be just inches from your face


eevlblog is legit.

Sagebrush
Feb 26, 2012

but the fuses are inside a heavy plastic housing. i've blown up ~22ga wires, about the same size as in those 10a glass fuses, with capacitors before and i can't imagine there being that much damage from one exploding wire encapsulated in glass and plastic and rubber. a startling bang and maybe destroyed meter sure but it's not like you're going to lose a finger?

now if you're accidentally probing something that's really high voltage, thousands or tens of thousands, i guess then you could be in poo poo, but i think most people encountering that sort of circuit would know what they're doing

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
the danger isn't the fuse itself blowing up, but rather the lovely non-hrc glass fuse not being able to terminate a very high current condition leading to other stuff blowing up

Arcsech
Aug 5, 2008

Sagebrush posted:

but the fuses are inside a heavy plastic housing. i've blown up ~22ga wires, about the same size as in those 10a glass fuses, with capacitors before and i can't imagine there being that much damage from one exploding wire encapsulated in glass and plastic and rubber. a startling bang and maybe destroyed meter sure but it's not like you're going to lose a finger?

now if you're accidentally probing something that's really high voltage, thousands or tens of thousands, i guess then you could be in poo poo, but i think most people encountering that sort of circuit would know what they're doing

generally true but better to have the protection just in case. a significant portion of eevblogs audience is professional EEs who are a lot more likely to run into that sort of voltage too. if you're a hobbyist who will never measure anything more than your arduinos power supply then sure get the $10 special

Eevblog dude knows his stuff

Olivil
Jul 15, 2010

Wow I'd like to be as smart as a computer
the problem also is that a lil bitty glass fuse is probably gonna arc even after it has broken with hvdc, causing a loving huge short which can lead to a plasma ball directly to your face

Sagebrush
Feb 26, 2012

that is a good point, i hadn't thought about arcing and all those conductive plasmas and stuff. i guess that's why the high power ones have ceramic inside?

movax
Aug 30, 2008

Sagebrush posted:

is the EEVblog guy on youtube good or is he a wacko? I watched some of his reviews of oscilloscopes and he seems to know what he's talking about, but he also sounds like he's just about to go off the rails, and I can't tell if he actually is or if it's just, his, infuriating, breathy, australian, ACCENT???

and some of the stuff i don't know how much stock to put in. like when he says multimeters that use glass fuses are "unsafe garbage", i'd never heard that before. maybe for a lineman sure but for a hobbyist poking at lvdc?

he's a cool dude generally, he does that full time and loves the hell out of what he does

Sagebrush
Feb 26, 2012

so can i get ceramic fuses of the same rating to replace the glass ones in my multimeter or are they necessarily different sizes?

Bloody
Mar 3, 2013

my solution is well dang i only work with poo poo that's like <10 volts <1 amps, ever

Sagebrush
Feb 26, 2012

kinda really want that rigol ds2072 he reviewed

i have your standard 30 dollar 20mhz analog scope but a digital one would be really nice for looking at logic and just look at all those cool features like waveform storage!! but i can't really justify 800 dollars as i'm still just a fart around hobbyist really but the 350 dollar ds1000 series doesn't look anywhere near as cool. gr

Bloody
Mar 3, 2013

the aforementioned logic thing that plugs into a computer (saleaeaea whatever) looks awesome and is pretty cheap depending on your bandwidth and channel count needs

Bloody
Mar 3, 2013

also i strongly dislike rigol scopes after we had some cheap as poo poo ones in undergrad that were the least responsive pieces of garbage ive ever used. tektronix 4 lyfe~

Olivil
Jul 15, 2010

Wow I'd like to be as smart as a computer
My Tek 465B is acting lately and I don't know if i

A: Fix it (but i dont have another good scope to do it)
B: Buy another ("refurbished") one
C: Buy an "ok" one and make a good one out of the two
D: Get a Tek 7704a and two dual-trace amps with a time base and a delayed time base for xmas

:(

Olivil
Jul 15, 2010

Wow I'd like to be as smart as a computer
Btw didnt the new Rigol scopes have faulty AC trigger coupling?

Maybe its fixed by now though (or you don't need it)

Olivil
Jul 15, 2010

Wow I'd like to be as smart as a computer

Sagebrush posted:

so can i get ceramic fuses of the same rating to replace the glass ones in my multimeter or are they necessarily different sizes?

you could do that but usually a "safe" meter is more than that. Like they will be designed in a way that there is no other possible arc-point in the build (between connectors and what not). also most of them will have blast proofing around the fuse and the connectors

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
thats it i'm buying a bunch of test gear and a parts stock and if mrs doesn't like it she can leave

i'm going INSANE

Olivil
Jul 15, 2010

Wow I'd like to be as smart as a computer

Jonny 290 posted:

thats it i'm buying a bunch of test gear and a parts stock and if mrs doesn't like it she can leave

i'm going INSANE

:cool::hf::cool:

Sapozhnik
Jan 2, 2005

Nap Ghost
some motherfucker suggested I get a Bitscope. I got a bitscope

for the task I was trying to accomplish with it (analysis of a SPI bus running in the low MHz range and also some GPIO activity alongside it) it's really a square peg in a round hole. no idea what it's like for analog stuff though.

also their software and API library are written in loving Pascal :psyduck:

ChiralCondensate
Nov 13, 2007

what is that man doing to his colour palette?
Grimey Drawer
lol at your 70 MHz dream scope

Adbot
ADBOT LOVES YOU

Sagebrush
Feb 26, 2012

Bloody posted:

also i strongly dislike rigol scopes after we had some cheap as poo poo ones in undergrad that were the least responsive pieces of garbage ive ever used. tektronix 4 lyfe~

the eevblog guy seems to think it's a great "entry-level good scope". yeah i'd love a tektronix but like, i'm not a fuckin millionaire and i don't do this for a job. well i do teach a little bit of electronics for a job but it's hackery stuff, nothing that really needs anything more complex than the 20mhz analog prole scope. id like to have a decent digital one to help debug students' projects though.

ChiralCondensate posted:

lol at your 70 MHz dream scope

well u know, depends what you do day to day. i lol at people who dream of machine tools costing anywhere less than $100,000

  • Locked thread