Arduino/micro-controller thread

RasPi is ~$30. An Arduino Nano knockoff is <$5 shipped.

It does seem to have gotten a lot easier since I last looked at it. Check out this page on GPIO perf. It’s actually somewhat fast with the native C library. All the other language bindings (shell/Python/Perl/Ruby) are totally hopeless, though. I implemented a 115k serial port on a 1 mips PIC; being unable to match that is just hilariously bad. 22 MHz is not quite impressive, but acceptable.

Wow, that’s a larger cost delta than I thought.

For any kind of hardware interactions on the RPi I’d write a kernel module to drive the appropriate chip peripheral rather than attempt to drive GPIO from userspace. From a quick glance (and we all know how accurate my quick glances are) it looks like the SPI controller can run up to 125MHz.

I’m impressed, but I think you might have discovered why Arduinos are popular :).

How painful is development of kernel modules, anyway? My only experience is on Windows, where it’s not too bad, but certainly more annoying than userspace. I assume Linux supports dynamic module loading so you don’t have to restart the OS? Are there GUI kernel debuggers available?

Just a couple of weeks I ago I decided to ‘save time’ by re-using some old code. Same kind of problem, finally after spending twice as long as it would have taken to re-write from scratch I realized the old code never had to initialize the list it was maintaining.

I’d be surprised if there aren’t any tools out there to simplify the process on the RPi, but when you’re armed with a hammer of a textbook all of your problems start to look like they need to be solved in the kernel.

Depends on your definition of painful. I’m writing character device drivers, so the interface with userspace is done via a file operations structure. Safely accessing userspace memory and peripheral registers requires a few API calls as well.

Yes, provided your driver doesn’t break the system and can load/unload cleanly. I needed to reboot the system a few times early on when I was learning what the hell I was doing.

I’ve done all of my debugging with printk! There are debuggers out there, but so far I haven’t had the need to use them.

I had a problem.

So I wrote a kernel driver.

Now I have −2,147,483,648 problems.

I haven’t seen a joke that funny since I canceled my subscription to Sensible Chuckle.

It’s not that I’ve been putting in a lot of hours on this project, I’m just a huge night owl.

Progress continues. I’m starting to plot out what I’ll have to do to draw text. I’ve got a capital ‘H’, but it’s still pretty wonky. I had a test program drawing a circle, and even when I tried to return to the starting coordinates (1 unit being 1 step of either the x or y motor) it wouldn’t close the loop. It could be that I’ll never be able to logically account for the slack in the system. I may have to massage my drawing coordinates by hand until the result looks right.

A real programmer? I give you The Story of Mel.

We just don’t code like that no more!

In a thread on parsing UTF-8, I did come up with the shortest code of the thread, when compiled to assembler. That made me happy.

Awesome. Kudos to both of you.

And as to the part of Robot Arm’s post that I snipped, yeah: almost all the true kludgetastic evils live in the cracks where the pure digital world connects to that nasty real world of, cough, moving parts. Good luck creating a compact yet accurate correction function for gear lash & cable slack. I can send you a few quarts of midnight oil if you’d like. :slight_smile:

No video yet, but I’ve got some still pictures.


I love the use of the window latch!

Thanks. I was walking through Lowe’s and looking for something that would hold the Etch-A-Sketch in place, and I just stumbled on it.

The original plan was to be able to be able to swap the E-A-S in and out easily. That may be less of a priority than I thought.

The Arduino kit finally showed up. Maybe I’ll have some time for this over the weekend. The kit includes an accelerometer, rotary encoder, and an 8X8 dot matrix display, so I can play around for a while until I think of some frustrating project that will keep me up all hours of the night.