News for hackers. Stuff that matters.
Re:I2C in a Nutshell by whalesalad on Wednesday January 22, 2020 @01:42PM (#22120574)
I've been having a lot of fun learning how to work with I2C on a Raspberry Pi with the Nerves framework. tl;dr it's an end-to-end development framework for deploying Elixir to embedded devices.

I2C was easy enough to understand, but understanding the obscure ways to configure and speak to a device has been really challenging. Spending a ton of time reading datasheets and experimenting with assembling binary messages.

The next time you are frustrated and unhappy with the state of modern web development (REST and/or GQL) take a ublox GPS chip for a spin and try to get it to give you high frequency location data. You will think, hey gee this isn't so bad after all compared to encoding and decoding a binary protocol by hand.

Re:I2C in a Nutshell by fpgaminer on Wednesday January 22, 2020 @02:53PM (#22121324)
> Spending a ton of time reading datasheets and experimenting with assembling binary messages.

That's embedded development in a nutshell. The only part you're missing is wasting a week of your life tracking down a compiler heisenbug, because embedded devices have niche, poorly maintained compilers.

Though to be honest it's a matter of taste; natural sadists tend to "enjoy" embedded.

Re:I2C in a Nutshell by whalesalad on Wednesday January 22, 2020 @03:24PM (#22121618)
The weekend project was recompiling the kernel and adding missing wifi drivers. By the end of the huge yak shave (just to use an external wifi antenna instead of onboard wifi of pi4) I was so relieved to see the device boot and have the wlan get an address.
Re:I2C in a Nutshell by keithnz on Wednesday January 22, 2020 @03:50PM (#22121872)
not to mention bugs in the micros themselves. I lost a few weeks of my life to one that would corrupt the stack in certain situations in an interrupt. The only way to debug it was with a logic anaylzer on all the memory / data lines / interrupts and decode it into opcodes and see what it was doing in the interrupts. Then when found, get bacck to the manufacturer who eventually gets back and says they already knew about it, but hadn't done and errata for it.... so yeah.... these days I mainly do backend/front end stuff :)
Re:I2C in a Nutshell by jlangemeier on Wednesday January 22, 2020 @03:24PM (#22121620)
Take the sadomasochism one step further; do FPGA programming, learn the joys of properly enumerated case statements (or the hell of finding what one is blowing up your flip-flop/latch diagram).
Re:I2C in a Nutshell by fpgaminer on Wednesday January 22, 2020 @03:37PM (#22121731)
You don't know true embedded BDSM until you've debugged incorrect timing constraints on an FPGA ... with a customer on the other side of the planet ... only to realize later that they have no idea how to design an HDMI compliant board and none of it was your own fault.

Or spending three weeks trying to achieve timing closure on a design, only to finally realize after much inspection of the routed designs by myself and an IntelFPGA FAE that the router was smoking digital crack the whole time and had no clue how to route their own divider units?

Or maybe the programming facility reversed bit ordering on a batch of the FPGA's flash chips and you only learn of that after a very, very long couple of nights of language barrier back and forth with a flummoxed customer.

The joys are endless.

Re:I2C in a Nutshell by thehesiod on Thursday January 23, 2020 @02:05AM (#22125489)
I had to rely to this, BTDT ;)
Re:I2C in a Nutshell by neillyons on Wednesday January 22, 2020 @01:44PM (#22120592)
Sounds cool. Can you access the GPIO pins directly from Elixir?
Re:I2C in a Nutshell by whalesalad on Wednesday January 22, 2020 @01:46PM (#22120624)
Yes. You're running on Linux (buildroot) so you can basically do anything Linux can do.

Here is the library you would use to do this via Elixir, https://github.com/elixir-circuits/circuits_gpio