Monday, September 29, 2014
One thing to watch out for is that the maximum stable clock speed for an AVR is reduced when running at lower voltages. ATtiny85s cannot run reliably at the internal pll'ed clock speed of 16MHz, when powered at 3.3 volts. I've cried myself to sleep over this, so I offer this cautionary tale. Read your datasheets!
Tuesday, September 23, 2014
I'm having some issues with my new domain for this blog, so I've temporarily reverted it to the old bytecruft.blogspot.com domain. Atom feeds may or may not be working and please disregard any wierd redirect warnings ove rthe next few days while I work it out.
Working in Raspian Wheezy, you have a lot of Debian Linux at your disposal, so I thought, "I'll just ssh in" That works great, from either a Linux VM, or using Putty on Windows. I needed to run graphical applications and spawn terminals at will, so I really wanted full desktop experience.
X11, the base graphic interface run by virtually all Unix-like operating systems, supports a feature known as display redirection. I used this back in the 90's when I tried to make use of a boat anchor DECstation from my Slackware Linux box. It still pretty much works the same way it did 20 years ago. Before I get too far into how it works, I'm just going to stop and and mention that if all you want is to remotely run graphical programs on your Rasberry Pi, stop right there! There is a much easier way! X11's server-client model is very powerful and flexible, and is unique in a class of technologies that has stood the test of time, but it's not very "get'er done" user friendly.
Linux machines support Microsoft's "Remote Desktop" protocol with two programs: xrdp and rdesktop.
xrdp is the "Remote Server". This runs on the machine that your want to remotely log into. Note that is this backward from X11, where the "server" is the machine with the physical display, and the client is the (remote) application that generates contents to display.
To install xrdp on your Pi (if using Raspian or other Debian Linux derivative), type:
sudo apt-get update
sudo apt-get install xrdp
You're pal apt will download, setup, and launch the xrdp deamon to start listing for connection requests. If you're parnoid, reboot your Pi to make sure.
Tuesday, August 26, 2014
The tl;dr version is: leave your RAM alone, let the operating system manage it. Teams of people smarter than you and I have figured this problem out.
How paging files work.
Mental experiment: a femto computer:
Monday, August 18, 2014
I swear by Oden, I shall return to this blog in full strength.
I'm pretty sure that you'll run into issues if you use anything but the latest browsers, I didn't do any testing of old browsers, and probably will always target the latest stable browsers.
I wrote a calculator tool for determining the target address for an AVR microcontroller relative jump instruction. The motivation was personal, I've spent a lot of time recently staring at hex dumps from AtTiny devices, I wrote a bootloader (more on that in a future post), and debugging it involved memory dumps of a lot of dynamically generated rjmp instructions. (AtTiny device do not have hardware support for bootloaders, so you have to fake it in software). I got tired of calculating it by hand, so I wrote a spreadsheet, and thought, "If I could write it in a web app, it would be there forever, and I'd always have access to it".
Check it out at:
Friday, May 16, 2014
Thursday, May 8, 2014
I've been pretty much head-down, working on things related to Anibit. I think some more of it will be public soon.
So the title of this post, is my Public Service Announcement about ATtinys. FMUL is Atmel's assembly instruction for "unsigned fractional multiply". Before you make grandiose plans that hinge on doing fast math in hardware, make sure your CPU supports it. Most, if not all, ATtinys do not support hardware multiplication.
Thursday, March 13, 2014
I have to say one stark lesson I've already learned is "Just because you've built it, doesn't mean they'll come". I have very little traffic to my site, and website traffic generation ranks substantially below marketing in requisite business development activities as far as my interests go. I know there are thousands or tens of thousands of people out there that would be interested in the site, but how do I connect with them? Part of building a catalog of existing parts was to attract a regular audience/demographic interested in hobby electronics. That, and other content I have planned (in the next phase, starting soon) would make Anibit bookmark/Feedly-subscription-worthy site.
But I get the feeling, given metrics to date, that there's more needed that just throwing content up and hoping for people to find it. Yet, I don't know what that thing is. My traffic to Anibit so far is dismal, especially if you cull the traffic generated by my personal Social Networking friends(lot of my hits cluster in places I or my family have lived). I supposed I should keep it in perspective (starting a business requires a healthy does of that). Self-bootstrapping with cash on hand like I am doing requires a lot of patience, and the experiences I've had while doing it so far have almost all been rewarding and overwhelmingly positive.
Tuesday, February 25, 2014
This is a reflow oven controller:
My oven controller is coming along, in between doing a lot of behind the scenes work on Anibit.com.
Monday, February 3, 2014
|The case with the "human interface" components - a touch screen LCD a 1 watt speaker.|
Sunday, January 19, 2014
A lot of work that I've done lately has been on something I wasn't ready to blog about... until now.
I'm starting a new website, devoted to hobby electronics and programming, and hope for it to become more than just a website, I'd like to use it to be a more substantial presence, and a greater contributor to the community, by publishing code, tutorials, and designs, as well as hosting forums and of course, I'd love to make my hobby, self funding, so it will feature a store, where I'll sell my original products, as well as resell other product of interest to the makers and programmers out there.
Without further delay:
Like on Facebook:
Or, if you're more of a pluser:
I plan to release most, if not all, of the code for the work I do on Github at:
Sunday, December 22, 2013
This is a traffic light I made for my kids. It's got a ATtiny 13 driving the leds. It also features a "soft" on-off circuit driven by a tactile momentary push button.
I know, another AVR LED based project. They're so easy. I swear, I work on more than LEDS and with chips other than AVR's. It's just that the AVR ones tend to get 100% finished. Part of my hopes for this blog is to provide motivation to finish a couple of the unfinished projects I have. Actually, looking back, it's not so much a problem of motivation, but time. I usually "multithread" my projects, work on several at once, to keep form getting burned out or over-obsessed with one. Sometimes, before I know it, a project hasn't been touched in a couple months.
This is a project I did for my kids, it was another one of those "in between" projects, where my goal was to make a small project that would be lightweight after working on something big.
|Present-day action shot, I finally replaced the 3+ year old batteries|
during the teardown/photo shoot for this.
The real neat trick with this project, in my opinion, was the power management.
Sunday, December 1, 2013
Monday, November 18, 2013
It's not dead, I've been occupied with family, and several projects I'm not ready to reveal yet (which make it hard to blog about).
In the mean time, enjoy this nerd humor:
Thursday, September 12, 2013
I have a really cool project I've been working on, that I'm not quite ready to reveal. It's turned out to be more ambitious that I originally thought, although I am making decent progress and achieving some things I doubted would be possible.
Is it that we overestimate our abilities, our speed, or that we have an inherent desire to avoid underachieving by aiming too low? My gut says.... well never mind what my gut says, it's always hungry, and rarely expresses anything appropriate for mixed company. My head says that we're simply just poor estimators, and there's probably tons of blogs and expert on the web that agree. What has really consumed a lot of the time on this project, were some of the mundane things that I didn't really consider, such as spending a week tracking down errors due improper CPU registers.
It seems that as some of my home hobby projects get more ambitious, and by definition more cool, I'm spending longer and long in between completed projects, with more time spent in the "this is going to be magical one day" phase. I definitely think after my current project I need a few short and sweet ones, to get that gratification of having achieved magic.
Wednesday, September 4, 2013
I'm posting this so that I can print it out and tape it to my forehead for future reference.
When trying to determine the root cause of strange behavior in your code, you have to sometimes use a process of elimination. Sometimes, it's best to check the easiest possibilities first, regardless of how likely you may think any given cause is. My code was behaving in pseudo consistent ways, something would fail, repeatedly. I would add code to try and catch the error before thing went haywire. I was convinced I had a memory overwrite, or a stack overflow. As soon as I would add the code to catch a problem. It would start working, or stepping though the code would give a different result than running full speed.
Here is a list of things to check while your scratching your head: (In this order)
- Fuses. (This turned out to be my problem). I had my fuses set for an external RC oscillator, instead of a crystal. Fuses are so easy to check, it should be the first thing you do. Scrutinize each setting, read the datasheet for each one.
- Proper capacitors on the external crystal.
- Breadboard noise. I rebuilt my breadboard, it started working better, but not perfect, so I'd assumed it was noise and a memory clobber causing the issues.
- Proper JTAG connection. (JTAG seems more sensitive to noise than SPI/debug wire debugging). To eliminate this as a possible cause, program the flash with the "device programming tool" in AVR Studio, using the generate hex file, and use the verify feature. Write some diagnostic code to print to a serial port, then disconnect the JTAG. If your problems go away, it may have been the tool.
- Memory stomp. These are pretty common, and can be hard to pinpoint, in pointer arithmetic-heavy code. Stack overflows are particularly nasty and difficult to detect, set breakpoints at your "deepest" code paths, and look at the SP register in the debugger. Comment/stub out large local variables, and eliminate recursion.
- Compiler bugs
Friday, August 23, 2013
Since most new devices ship with Ice Cream Sandwhich or higher these days, a great thing to watch out for as far as performance is RAM size. Android 4.X+ just seems to want 1 gig of RAM or more. I've seen ICS and Jellybean on half meg devices but they are almost always janky, while occasionally giving illusions of usefulness. That doesn't stop me from trying a new ROM for some of my aging devices when a I notice a new one on XDA.
I'm sending my latest acquisition back to Grandma... and I'm replacing it with a "major brand" refurb last-year's model. It did cost a bit more than $60, but it has a ton more features too, but the feature I like the best is that it actually works.
Thursday, August 1, 2013
Here's an updated color-coded architecture diagram. I've decided to drop the speaker output feature, mainly because I'm not sure what I'd do with it, but I may resurrect the idea.
|Compare to my original chart here|
I've got the Pawn scripting working pretty well, I've got some of my low level functionality exposed as Pawn API's, and I've adapted the Chibi/OS shell to treat Pawn bytecode files as "executables" that I can optionally launch in a background thread.
I could probably fill 20 pages with all the developments, but I'm not going to, I just spared myself enough time for a brief post.
Here's a video showing a script running that tries to navigate a square. The compass and and encoder readings are queried in the script to detect 90 degree turns and half meter movements. The compass code is probably beta level, and I'd call the encoder tracking alpha level, so that's why the square is somewhat off. Eventually, I'll have more elaborate geo-spatial reckoning, so that I'll simply command the robot to "go to coordinate x,y, and it will figure out how to get the from the current position(avoiding obstacles too of course). I hope this comes out, Blogger doesn't seem to have an easy way to preview video before publishing a post.
Monday, June 10, 2013
I did recently score a cache of small, nay, tiny AVR chips recently, and my wife had an interest in making something with them (maybe I can get her to guest-blog about it). Anyways, I was at a local hacker meeting this evening and the subject of programming Attinys came up. As it happens, I just built a couple of Little Wire devices, but couldn't remember the name at the time. For some reason, the name makes me think of Jimi Hendrix. It's an Attiny85 based device that combines USBTiny with VUSB. The really cool think about it is that you can make an AVR programmer for roughly $3 USD worth of parts (and considerably more labor, but it's not work if you love it right?)
Here's one of my rat-nested Little Wire AVR-ISP devices:
|Well she's walking through the clouds....|
The Attiny 85 has a neat feature that I had overlooked until I built this in that it has a built in PLL that lets you run the system off the internal RC oscillator at around 16Mhz. Many other AVR's lack that PLL, and can only run at 8Mhz maximum without an external crystal.
I like saving my AVR Dragon for when I need to debug or do JTAG.
The easiest way to use Little Wire is with avrdude (I copied the avrdude executable and conf files from the arduino instalation into thier own folder). I then run:
avrdude -c usbtiny -p t84 -U flash:W:<path to my hex file>:i
To burn AVRStudio built hex files into (in the above case) an Attiny 84 chip.
Thursday, May 9, 2013
- My robot project has stalled somewhat, I just need to set aside time for it. It's been on the verge of awesome for several months.
- I'm working on a new website, that I hope will let me be more involved with the maker/tinkerer community.
- Not ready for prime time yet
- I've never really done heavy website work before, if Drupal/PHP/css can even be considered "heavy".
- rest assured, unwashed masses, this blog isn't going away. I still have a goal of one post per week, though rarely ever meet that goal.
- I recently invested in a Laser Cutter, that should, along with my CNC mill/printer, really let me make stuff I never thought possible a few years ago.
- I'm helping my wife with her first microcontroller project, yes it involves blinking LED's :)
- I'm currently building my own "Little Wire" AVR programmers, I want to make some quick and dirty no-fuss bulk programmers maybe.
- I got the idea for this post when going back to my Indictron post, to check how I wired up the USB (I can't get enough detail from the blog pictures, I'll have to dig into my private notes.) I still use the build monitor at work, though it's been having PC software side issues lately.