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
Corla Plankun
May 8, 2007

improve the lives of everyone
I just got a job doing embedded code with a dspic and I am really interested in doing things the right way instead of just doing them. My work involves signal processing, serial communication, and a host of digital outputs--I know how to do all of these things one-at-a-time but I am worried about getting them all to take turns nicely. Does anyone know of a good resource (free or paid) that could help me think about this in a constructive way? I think I need to develop an interrupt-driven scheme to keep everything working when individual modules take too much time, but its tricky to tell which parts should be interrupts and which should be in the main loop.

For what it's worth, I'm using MPLAB X and programming in C. Most of the resources I have found are either too basic or they use assembly and it takes too much mental effort to translate that to C.

Adbot
ADBOT LOVES YOU

Corla Plankun
May 8, 2007

improve the lives of everyone

Delta-Wye posted:

Any reason you couldn't just knock out an easy dev board of your own? If you're willing to program the bare processors, you don't need a whole lot of parts and then you can make the footprint whatever you want. Should be trivial to beat the $30 mark too.

This is probably the best answer. Get a breakout/protoboard to make it easier to deal with tiny pins and then go to town adding only the stuff you need.

Corla Plankun
May 8, 2007

improve the lives of everyone
Do you all think it is possible to reprogram a microcontroller over a serial bus with one master and multiple slaves?

The application is basically an accessible master node and a bunch of physically inaccessible slave nodes. When it comes time for a firmware update, it would be awesome if I could reprogram the slave nodes from the master node's bus connection (or even just using the master node). But this is a really weird thing to do and I can't find any information about it on the internet.

In this situation, all nodes would be reprogrammed with the exact same firmware, so it would be totally okay if the reprogramming worked globally.

Corla Plankun
May 8, 2007

improve the lives of everyone
Its a design choice that I haven't really made yet, but I was thinking about RS485 because it seems appropriate for the application. Communication will only be initiated by the master and it will address slaves individually, although I am toying with the idea of a broadcast address that directs all slave nodes at once (and obviously doesn't expect a response to maintain a collision free bus). The latter method would be an easy way to reprogram everybody at once.

I think I am at an impasse because I don't really know how the actual hardware portion of microcontroller programming works, and I'm not sure how hard it would be to create a device that programs microcontrollers (or itself). I suppose I will read up on it.

Sorry about being vague, but the network and controllers are t.b.d based on this inquiry, and I also had to sign an NDA :/

Corla Plankun
May 8, 2007

improve the lives of everyone
Do any of y'all program microcontrollers with a linux toolchain?

There are so many huge, proprietary IDEs out there that it seems like it might be hard to do, but I would love it if I could slim down the development process to just gedit and a makefile. I just tried this out with a Maple this morning, but it hasn't been altogether successful.

Corla Plankun
May 8, 2007

improve the lives of everyone

JawnV6 posted:

I'd be very curious how you plan to debug anything nontrivial with that setup though. Debugging in an IDE with breakpoints and awareness of your code will take a fraction of the time compared to debugging with LED's providing bits of information about what's going on inside.

I've never used any of that stuff so it is all just bloat to me. Maybe I have never encountered a nontrivial bug?

Corla Plankun
May 8, 2007

improve the lives of everyone

JawnV6 posted:

I had a +5V rail drooping that was causing the ADC reading referenced against another plane to come back a little goofy. Of course, it didn't manifest in any sensible way the device just kicked into the next stage of operation. The ADC reading wasn't the only possible transition, it wasn't 100% fail, etc., so it took some onion-peeling to root-cause it.

You can totally figure that out with a multimeter, an array of LED's to show the 12 bit ADC reading (once you somehow figure out that's what's going on) along with the state machine position and a dozen other triggers. But sweet jesus why would you subject yourself to that instead of using a tool designed for explicitly this scenario?

Maybe your 3rd month on the job will have one.

I tried to do some register-/memory-peeking stuff with MPLab X and it was really cumbersome and counter-intuitive so I ended up writing my own thing that dumped what I cared about to the serial bus CSV-style every time it was modified so that I could put it in matlab and do weird stuff to it on my own.

Judging by the discussions on microchip's forums, I think MPLab X is just a really bad IDE so maybe the other ones aren't so bloated-yet-unhelpful.

I'm sorry for constantly posting dumb stuff in this thread about my noob idiot part-time embedded coding internship, but the main reason I post whenever any dumb thing comes to mind is because it seems like this thread is often dangerously close to falling off into the archives and I like it a lot and want it to stay alive.

Corla Plankun
May 8, 2007

improve the lives of everyone
Why don't you just use the right pin?

Corla Plankun
May 8, 2007

improve the lives of everyone
I impulse bought a couple Photons a while back and they just came in. I didn't do enough background research and it turns out these things are a huge pain in the rear end to develop on. The particle team has "disrupted" the poo poo out of embedded dev by making every interaction with the photon have like 4 different middle men ~in the cloud~

Flashing the LED blink script to my Photon doesn't make it flash its LED, it just puts it in safe mode for some reason. Have any of y'all had better luck with these things?

Corla Plankun
May 8, 2007

improve the lives of everyone
Patterson and Hennesey is the standard for computer architecture 101, so the negative reviews are probably just sad undergrads. I would definitely recommend it. It has tons of really good information and it is one of maybe 4 textbooks I used in undergrad that I was actually really excited to read.

Corla Plankun
May 8, 2007

improve the lives of everyone
Ha! Yeah, I was talking about "Computer Organization and Design". I don't know anything about that other book.

Adbot
ADBOT LOVES YOU

Corla Plankun
May 8, 2007

improve the lives of everyone
Use the verbose flag when you SSH. I had this problem at work and it turned out that SSH was trying like 200 ways to authenticate and THEN trying the one that works. You can set arguments to disable some of the types you aren't using.

Edit: Sorry I left out a step. Use the verbose flag and then google the line that it slows down on. That'll show you what you need to disable.

  • Locked thread