Blogs

L'Hexapod: ATTiny2313 24 channel servo controller schematic

Previously published This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here. Here is a schematic for a 24 channel version of the ATTiny2313 servo controller. You can expand the number of channels up to the full 64 by adding additional CD74HCT238Es where each additional MUX chip is connected to the next available pin on port b.

L'Hexapod: A timer driven PWM servo controller - part 4

Previously published This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here. The time has finally come to put all of the code from the last three parts of this article together to form a complete serial configured, 64 channel, PWM servo controller for the ATTiny2313 and several CD74HCT238Es.

L'Hexapod: A timer driven PWM servo controller - part 3

Previously published This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here. This is part three of a series of articles about the servo controller that I’m building for use in the hexapod robot that I intend to build. The first two articles in the series have presented the timer driven PWM generation code and the code used to take the configuration data that is managed by the serial port protocol and convert it into the data that is needed by the PWM generation code.

L'Hexapod: A timer driven PWM servo controller - part 2

Previously published This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here. In part1 of this timer driven PWM servo controller I built some code which uses Timer1 in the ATTiny2313 to generate 64 PWM signals. The code in part 1 worked from hard-coded dummy data. The code presented here shows how we can create the data that the PWM generation code needs to run.

A time and a place for comments

I’m fairly set in my ways about the value (or lack of) of comments in C++ code. I tend to have very few comments in my code and I tend to favour names and structure over comments; names and structure compiles and doesn’t lie. Sometimes I go too far in that direction and I’m forced to fight with some of my old code and at that point I might add a comment that explains the non obvious but I’m more likely to attempt to refactor the code into something where the names and structure tell the story better.

Globals are evil

Jamie Fristrom over at GameDevBlog thinks that “Globals are underrated”. I disagree, and, agree with most of the comments that Noel makes; globals and their 90’s equivalent, singletons, are evil. As anyone who has looked at the code that I present on my blog knows, I tend to favour ‘prarameterise from above’ in my designs. That is code that doesn’t reach out to a global for something but that only works with what it has been given.

L'Hexapod: A timer driven PWM servo controller

Previously published This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here. As I mentioned recently, the original servo controller firmware that I posted was flawed and wasn’t suitable to use as a base for the more complex servo control code that I want to add to the controller. The new firmware follows the design that I spoke of here and relies on the ATTiny’s 16-bit timer to generate our PWM signals.

Asynchronous spreadsheet calls in a Managed XLL

Once I got the simple managed Real Time Data servers working in Excel I decided it was time to add asynchronous worksheet functions. This is the last major feature on my todo list and once it’s complete I’ll be ready to start thinking about beta testing my Managed XLL product. The idea behind asynchronous worksheet functions is that some worksheet functions may take a long time to complete and it would be better to run them in the background rather than have them block Excel’s recalculations whilst they complete.

Error: Cannot pass a GCHandle across AppDomains

I’m currently working on adding easy to use Real Time Data server support to my Managed XLL Excel Addin system. This lets you use the =RTD() functionality of Excel to push real time data into your spreadsheets without needing to understand COM and without needing to register any COM objects on your machine. You simply add some attributes to your managed code, compile your assembly and drop it in the same directory as the Managed XLL and it does the rest.

L'Hexapod: Redesigning the servo controller firmware

Previously published This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here. As I mentioned here, there’s a fundamental design problem with the two versions of the ATTiny2313 servo controller firmware that I’ve presented so far (see the 8 channel source code and the 64 channel source code). The timing that determines the shape of the PWM signals that are generated relies on carefully crafted timing loops and the time taken by particular code sequences and this is affected by the interrupt driven serial I/O that is used to control the controller.