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
a cyberpunk goose
May 21, 2007

hobbesmaster posted:

neg my chip select

twist my pot

Adbot
ADBOT LOVES YOU

a cyberpunk goose
May 21, 2007

resist my flow

a cyberpunk goose
May 21, 2007

hobbesmaster posted:

so i need to be able to program some simple little spi flash chips, whats the professional version of bus pirate/flashrom because thats slow as molasses

bit bang it with an arduino :unsmigghh: (really easy to do actually, and potentially "fast enough")

a cyberpunk goose
May 21, 2007

hmm...(!)


hmm...(!)

a cyberpunk goose
May 21, 2007

DNova posted:

btw I think I raped my rpi gpio with 5v a bunch of times on accident but it liked it so no crime was committed

dont do this, both the 5v tolerant gpio and the lovely language

a cyberpunk goose
May 21, 2007

movax posted:

i've just finished getting our custom jtag subsystem working

:eyepop:

a cyberpunk goose
May 21, 2007

Bloody posted:

explaining spi is nice because it's so loosely defined. the poo poo i have seen, man. i have seen some poo poo. lvds spi. ddr spi. spi where chip select actually does nothing and god help you if you have anything but the most pristine clock line from power up until forever.

gently caress spi.

i2c is nice if you don't mind some slow as rear end upper limit and don't have to talk to it with an fpga

spi isnt spi isnt spi

you got to configure poo poo like what edge do the slaves need to latch on, what polarity etc. if the diagram is drawn out you dont even need to read the (possibly lying) technical summary of the spi configuration, you can take a glance at the signal diagram and know how to configure your master.

i worked on a stack at my last job that had a fuckload of things sharing a single spi bus (we had a multiplexing chip to handle the 8+ devices listening to that bus) and different slaves had different mandates like the DACs and ADCs did different things w/ spi, along with boards that had other mcus that wanted more stringent timing etc. so i had a bunch of dumb logic that would configure spi for each target communication

madness

madness

a cyberpunk goose
May 21, 2007

rec

movax posted:

let me tell you about the shift register known as jtag

jtag owns bones.

recommend me an all purpose JTAG debugger I could use with OpenOCD or something of that ilk

ideally not the jlink because it's kinda expensive imo

a cyberpunk goose
May 21, 2007

movax posted:

ft2232 based things are decent and inexpensive, if used with a non-lovely userspace application

not sure how they do with adaptive clocking tho

is adaptive clocking up to the host doing the debugging? or the processor/soc/debugging architecture you're interacting with?

i know nothing baout jtag and am trying not to if ic an help it

my mission is to have a general purpose debugger i can plug into w/e headers i want and it's okay if it can't autodetect just as long as i can ask OpenOCD to talk to the target devicea s if it were $SOME_SPECIFIC_PROCESSOR at $SOME_SPECIFIC_CLOCK and have it work most of the itme

a cyberpunk goose
May 21, 2007

DuckConference posted:

we're doing our next product with an stm32f4, and since Kiel uvision 4 kind of sucks, it looks like we might go with gcc/eclipse/openocd. it's not a horrible idea is it?

also how does an ide in tyool 2015 only rarely have text completion actually work. and also store what windows you have open in the same file as project options you care about so you have to version control that file and then of course you have an incompatible change every time you even open a window in the bloody project. wtf keil.

we avoided iar and stuff at my last job and went with Kinetis and the Kinetis Design Studio thing which is just Eclipse with a bunch of plugins they made for configuring the cpu and generating some C stuff which wasn't as bad as i expected it to be

i have set up basic gcc toolchains in eclipse for building ARM targets and stuff and once you get past how annoying eclipse is to configure it's generally serviceable :shobon: this was internal product poo poo that wouldn't see the light of day though, so the onus was different for me

a cyberpunk goose
May 21, 2007

Fanged Lawn Wormy posted:

i'm getting interested in taking the arduino training wheels off and using big boy developer tools for embedded systems

but like, where do i even begin? part of the issue is that I have no real reason for needing to go to better tools because the stuff we do at work is usually very simple so things like port manipulation etc are really overkill, so I don't have a lot of practical things to try right now but I really want to get to use the nicer debug tools

so, i get that if I want to do AVR stuff i'm going to need to learn more C/C++ (i'm okay with that)

but like, is there a book or something for embedded systems out there? what will change for me?

it depends where you are at, I learned a lot by just taking the programming manual for a SoC and making my own linker script and C bring up code with determination and self hatred and esoteric examples

understanding what the clocking pathways are and how to configure them and what modes various pins are listening to or are on when it comes up from power off is pretty cool. it helps to ask an unfortunate rear end in a top hat a poo poo ton of dumb questions too. C toolchains for embedded are horribly convoluted and it's hard to decipher what is helpful cruft and what is truly essential

a cyberpunk goose
May 21, 2007

Mr Dog posted:

if you want to learn this poo poo on your own time (please do not inflict your learning process on your employer, for them you should do some simple poo poo that might not be super optimally cost effective but that will at least actually work i.e. use a Raspberry Pi for everything) then i guess try the following:

First, actually learn C in a cozy environment like a desktop IDE. Do not learn C++.

Go to olimex.com and buy a board with an STM32 on it that you like the look of.

Do some research, find a JTAG pod that will work with OpenOCD that you can hook up to your STM32 board.

Do some research, learn how to build a cross GCC and Binutils toolchain targetting ARM (see if you can manage to do this without pulling in the Newlib libc)

Read the datasheet for the STM32, learn how its address space is laid out, write a linker script (from scratch, most examples have a ton of ancient copy&paste cruft that hasn't been relevant since the 90s).

Write a CRT (C Runtime). A CRT is a small chunk of code that sets up the CPU to the point where it can run ordinary C code. Microsoft are loving obnoxious and call their C standard library the "CRT", that's not wha a CRT is. Anyway. The STM32 has a Cortex-M3 CPU core inside it. One of the nice things about this CPU is that you can even write a CRT in C: all you really have to do is clear memory and then copy the initial values of your variables into RAM from ROM.

Most of this stuff is googling but then that's what you're going to be doing a lot of anyway.

final step: utilize, understand and worship CMSIS, i never got here :(

a cyberpunk goose
May 21, 2007

also: having an oscilloscope makes verifying your poo poo a lot easier, it's easy to sanity check your clocking by toggling a GPIO in a while loop and also debug a bus or two. i used the gently caress out of my scope to verify poo poo once i could run arbitrary c

a cyberpunk goose
May 21, 2007

JawnV6 posted:

never understood the fixation some people have on linker scripts and make files. you've got C and asm, and a bunch of knobs to fix the translation between them. becoming an expert knob maker doesn't help the final product as much as a half dozen easier things

i dont think anyone should ever bother to make a linker file more than once, but it's a really good exercise to force you to understand how when you write C you aren't writing code in a vacuum

there's a lot of poo poo across the full stack of your toolchain that eeks its way into the C you write even if you don't realize it, defining linker variables that point to blocks of memory and then referring to them in C basically make them one and the same

a cyberpunk goose
May 21, 2007

C is a nightmare of a lang to do any project of scale in because of how loosely defined it actually is, and this fact can burn you really bad if you don't respect that fact

every time you write code you are writing in a dialect

the lang actively encourages you to write macros and elaborate generics that turn into your own bespoke dialect

a cyberpunk goose
May 21, 2007

JawnV6 posted:

just use the friggin GUI with big red breakpoint buttons and arbitrary register/value tools. it drives me crazy to see people chase this fantasy that's Yet Another Abstraction then whine about all the problems they invited to their lap after pretending IDE's aren't "real"

absolutely use IDEs and any tools that will make you not have to worry about that poo poo

but understand wtf the IDE is and is not doing for you so you can make informed decisions when it comes time to troubleshoot issues in your toolchain or make future tooling decisions for various processors and stuff

the ARM tools for eclipse have makefile generators that you can specify architectures for and overall it Just Works, even better if your mfg of choice has their own eclipsey plugins that will do their own linker script generation and generate boilerplate driver stuff for your SoC like interacting with the DMA engine or generating startup code for things like clocking changes you can wrap in a state machine

a cyberpunk goose
May 21, 2007

JawnV6 posted:

no, no, no, suffering Must Be Better. any Tool is an Abomination and must be abhorred. for any given protocol if you don't write a bit-banging version first you can't possibly understand how to use a HW module that does it for you

i implemented 1wire with just TI's documentation and my scope to verify timing, that was a hell of a bit bang

edit: to clarify 1wire is some baby poo poo i just had never done anything like that, since you have to flop the GPIO from input to output and read things in sensitive timing ranges and dumb basic poo poo i'd never done

a cyberpunk goose fucked around with this message at 18:23 on Apr 9, 2015

a cyberpunk goose
May 21, 2007

Arcsech posted:

given that vivado is a java app, yes, this is exactly what fpga tooling will be like 10 years from now

:colbert: this isn't a crime in and of itself, java is a fine lang to house this sort of tooling

a cyberpunk goose
May 21, 2007

Bloody posted:

this loving question/problem haunts me like every two months or so and i still do not have a useful solution

find a SoC that abstracts as much of that poo poo away as possible

an RMII IC + Kinetis K6* series chips + their little Kinetis Design Studio thing will generate the ethernet related calls at whatever level you're comfortable with

then you just be like

Ethernet_SendBytes(buffer, buffer_size);

there's no easy solution that doesn't have tradeoffs.

option 2: become a master of the USB 2.0 spec, a curse i wish upon no one

a cyberpunk goose
May 21, 2007

hobbesmaster posted:

serial ports can do a megabit, 10 times faster is 10baseT

also true

a cyberpunk goose
May 21, 2007

:mrgw: looks like my name is on someone's short list for good emb-c devs

looks like i might soon be quoting some startup $60/hr for 2 weeks of side-job work writing some low level drivers to poll adcs on command, easy $1.5k i'll be chatting with them tomorrow about more specifics

edit: yes $60/hr is really really low

a cyberpunk goose fucked around with this message at 08:26 on May 10, 2015

a cyberpunk goose
May 21, 2007

Mr Dog posted:

dude wtf r u doin

writing like 5 functions that the non low level dude can call

it's like 100-200 lines at most and most of the unknowns and time sink will just be loving with Keil tools and maybe pokin a trace with a probe when the adc doesn't react as anticipated

I'm p bad at gauging how much my time is worth but my fear here is all the unknowns, don't wanna bill $300hr on something that doesn't pan out or maybe I don't end up with enough spare time to weekend warrior it etc

a cyberpunk goose
May 21, 2007

ChiralCondensate posted:

at least go for $150

ok will do

a cyberpunk goose
May 21, 2007

Mr Dog posted:

fwiw i too am awful at negotiating and knowing what my time is worth etc but i do know at least that $60/hr for freelance embedded dev work is so low as to not get you taken seriously.

:agreed: subconsciously I think I knew 60 was low enough and needed yosposters to make fun of me

thanks team

a cyberpunk goose
May 21, 2007

atomicthumbs posted:

this is a bit distant from this thread's usual discussion topic of boring stuff like microcontrollers and other tiny computer, but does anyone know if there are any good books on pulsed power circuit design?

I have this 6x225 uf 1.5kv laser capacitor (6 caps in one case, sharing a common ground terminal) and I need to figure out how to build the rest of a pulse forming network. Also I need to figure out a way to keep the crusher coil I'll be connecting it to from ringing, since the capacitor's only rated for 20% voltage reversal

how's noise bridge??

a cyberpunk goose
May 21, 2007

just got off the phone with the startup that needs emb-c work

i put my dick on the table at $150/hr and a dead silence dropped :lol: i stuck to my guns though

it sounds like they want to put 2-3 hours down for a research spike so i can look at the tools and maybe just give their main programmer guy a jumpstart on the magical world of embedded C

a cyberpunk goose
May 21, 2007

Raluek posted:

lol 'cause digging their lead programmer out of a hole so their company goes from "nobody here knows what to do" to "we can now build our product" is only worth a couple hundo

this is sounding familiar

a cyberpunk goose
May 21, 2007

what they really wanted was a magical enthusiastic team friend to join up and get paid for ~passion~

a cyberpunk goose
May 21, 2007

:sigh: i decided to tell those guys that i'm just too busy to take on a low level C project but can field some basic no guarantees questions in the future if they need

truthfully they are just super weird and don't have their poo poo together and I don't wanna deal with another startup where some dudes without real funding or planning skills. their product is dumb as poo poo too and will never work

a cyberpunk goose
May 21, 2007

they don't have funding yet and want to make a super over complicated prototype before their kickstarter (lol) with bells and whistles that are really fiddly and error prone without a lot of involved signal processing that they wanna offload through BTLE to a phone and just ugh

I don't know why people don't just fukkin use arduinos and poo poo to test their dumb theories

a cyberpunk goose
May 21, 2007

fritz posted:

we've been keeping the 'well maybe we can offload the computation to the host and send the results back' option on the table for a 'oh god everything else we tried failed' situation

that's cool depending on the characteristics of the data channels and what the data is

a cyberpunk goose
May 21, 2007

Bloody posted:

nope. closest candidates so far are a silabs chip with a 4-bit current dac (current would be fine but 4 bits is wtf?) and a csr8670 which may or may not be usable but i will probably never know because they do not seem to be people who deal with low-volume people although the part is on digikey??

http://www.mouser.com/new/panasonic/panasonic-pan1740-ble-module/ maybe??

edit: nope lol

a cyberpunk goose
May 21, 2007

writing hdl stuff seems like writing one level above doing npn/pnp gate layout for logical constructs (i'm p sure it is??? i still haven't written a single line of hdl-anything, if someone lays out a list of tools and a way to get started ill gladly do a hello world simulation verification thing)

a cyberpunk goose
May 21, 2007

SCLK: ______|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|

a cyberpunk goose
May 21, 2007


lol it doesn't base64 the json description or anything

a cyberpunk goose
May 21, 2007

JawnV6 posted:

i2c wat u did there

a cyberpunk goose
May 21, 2007

JawnV6 posted:

i got the reset pmic, fumbling on oscillators now ugh

I got stuck on the latch mechanism :/ couldn't figure out how to make it simpler

a cyberpunk goose
May 21, 2007

Bloody posted:

a scope, a dece iron, a microscope, and a bench supply

do it

a cyberpunk goose
May 21, 2007

I would draw the line between the philosophy behind the MCU/processors intended use of the internal byte code architecture

no one (sane) is making really elaborate operating systems that run on PIC, you... could but it's not suited for it compared to say a Motorola SoC with an arm core

Adbot
ADBOT LOVES YOU

a cyberpunk goose
May 21, 2007

Barnyard Protein posted:

yeah but there are PICs with MIPS cores :colbert:

my language was carefully chosen

  • Locked thread