Latest entry

Posted on 07-04-2008 under avr

As promised, here come the schematics.

Porgrammer Schematics v2 [pdf]

If you want to run this cable with PonyProg, in the Setup->Interface Setup dialog choose Serial. In the drop-down box choose SI Prog API. In the check-boxes below you’ll have to check all except RESET.

Pony Prog Settings

If you’re using avrdude, you’ll have to add the following to your avrdude.conf file.

# SIPROG Inverted programmer
# reset=!txd sck=rts mosi=dtr miso=cts

programmer
  id    = "siprogn"; 
  desc  = "Inverted Lancos SI-Prog “;
  type  = serbb;
  reset = ~3;
  sck   = ~7;
  mosi  = ~4;
  miso  = ~8;
;

More information on the programmer is in the README.

A shot of the cable is below. Its short, but thats because we had already converted the serial port signals to TTL. Of course this is really too short. You can make it a bit longer. Ideally of course, you the longer length should be before the level conversion stage. If you can get your hands on a serial cable, that would allow and instead of plugging the programmer into the computer, you plug it into one end of the cable, you can really extend its operating distance.

Programming Cable

REFERENCES:
LancOS’ site has a few nice serial schematics but all of them use discrete components to do level conversion, and frankly, I dont trust discrete components. At least, not the ones available in our maket. This schematic shows the pin connections on the serial port for the SI Prog programmer. Using this allows us to program using PonyProg.
This page uses a similar Max232 connection. We got the idea to use 10nf capacitors from here, thus reducing the size of the ciruit.

NEXT STEP:

USB. woo!! This is gonna be really easy actually because some circuits are already available online. One of these I really like is ladyada’s circuit. Although I think I can do away with the buffer. And I might have to replace the ATTiny with an ATMega8 because I might not be able to find it in the market.

EDIT [ 14th July, 2008 ] : Corrected a problem with the RESET circuit.

Posted on 07-03-2008 under avr

Our brand new office PCs didn’t have serial or parallel port in them. USB is great for normal people, but we NEED serial and parallel ports to do our work. We then have to buy extra hardware to add serial ports via USB.  Which is getting more and more expensive and less and less reliable.

For example, we bought a PCI parallel and serial port adapter which looked promising enough. Unfortunately it refused to budge. After much scratching of chins, and a lot of poking around, ranging from loading userspace drivers on Windows, to installing Debian and trying to access the port from there; we found that the chip on the board was faulty. Similar problems lie with almost all converters that are available in the market, or so I’ve heard.

We had to actually “make” a serial port by pulling lines directly from a header on the motherboard.

So we banged up a simple RS-232 programmer that uses the serial port to program an AVR. Simple and minimal, it uses only a MAX232, a transistor and diode, and a couple of resistors thrown in for good measure. Estimated price, under Rs. 100. See the pic below. (All the soldering is credited to Qaiser Hussain who is amazing with an iron).

Avr Serial Programmer Front

More details, including schematics and programming instructions coming soon :)

Posted on 06-30-2008 under general

“The next phone I buy better be able to read my USB hard drive”, was what I said one day. It seems mobile phone manufacturers are developing a totally unrelated feature, (namely cameras), and ignoring a huge opportunity. Just thinking about the possibilities made my mouth water. I could hook up my phone with my drive and watch movies, listen to music, edit documents, without having to be restricted by my memory card. And interoperability wherever there is a USB port, which is everywhere by the way. Yummy! “So stop making cameras and do something worthwhile, phone developers!!”.

Actually, progress is already being made. [Link] Sweeet!! I can’t wait till they make this more mainstream. While the device doesn’t seem to have enough juice to power a hard drive, its a start and I’m not complaining.

On a side note, why does every idea I have turn out to be already worked on? …

:\

Posted on 06-30-2008 under general, site updates

After almost a month of having an expired domain name, I’m back :)

And I’m bringing a boat load of worries with me. For starters, when the heck am I going to be called for my visa interview. !*&@^ it. At the current rate, I’ve already missed my orientations, and am about to miss the first week of classes! Secondly, one of the subjects I wanted to take was already full, and I had to waitlist! Worst part is, it won’t be offered till next fall!!! Strangely, more people are getting onto the waitlist after me! Must be a really popular class.

On a lighter note, I wrote a little script to restart my Internet connection if it goes down. Which it seems to be doing a lot of. Worldcall’s customer service is as helpful as a soggy pile of wood. Getting a word through their “restart your computer” mumbo jumbo is just impossible. I’m running Linux for crying out loud, and no I can’t restart my computer every time your cables twist up! Anyway, so I’ve been testing the script (which I’ve aptly named ‘ifrestart’). And it seems to be doing a good job. Earlier, I would come home from work, and find that the computer was offline the whole time I was gone. It got to the point, it would disconnect, just as I stepped out. (My modem is alive I tell you!)

After much cursing and banging my fists, I realized that that was no use, (thats why neanderthals went extinct). And I wrote a shiny new script. This one taking a lot more time, effort and skill. Woohoo! I’m getting better :)

Whoa! Guess what? Worldcall disconnected me again :) Right while I was typing this post. Just beautiful.

I’ll be posting about the script soon. Right now, I’m gonna chill.

Posted on 05-19-2008 under linux

The recent frequency of electric breakdowns, coupled with sitting in front of a dimmed laptop screen hoping against hope that the power would come back on before my battery died, produced an interesting result. Fortunately, my brain doesn’t need electricity to light bulbs in the air above my head.

With the blessings of KESC and Worldcall, I went through some web pages about ACPI, the linux power management framework. I found this website quite helpful. Really interesting stuff. (No seriously).

In particular, reading sections 6.3 and 6.4, I struck on a wonderful idea. What if I could log when KESC shuts down my electricity and when it brings it back up. Now what if that data were to be made available on the web!

No, its not that awesome. Still, it would be interesting to see the trends (or lack thereof), appearing through the statistics.

For those of you who don’t want to read my ravings about how I did it, here’s the link to the log. Let me know if you have any problems viewing it. Keep in mind, this is running off my laptop, with my not-so-reliable connection, so you might see some problems.

Now to the meat. There’s this daemon by the name of acpid which should be running on your linux system already. It’s included in most distributions, so if its not running you can probably install it very easily. This daemon has certain events that cause it to do certain things. For example, if you’ve got a laptop with some extra keys (brightness, hibernate etc.), its more than likely they’re functionality is controlled through the ACPI daemon. What we need to do is find the events corresponding to AC Power and Battery status. In my case these were ac_adapter and battery respectively. (If you haven’t read the sections in the article I mentioned earlier, I strongly recommend you do so before reading further. The path names could vary depending on your system, as they did in my case.)

What we need to know is that there needs to be a file in /etc/acpi/events/ that indicates which script to run when a particular even occurs. In addition, of course, there needs to be a script file for the acpi daemon to actually run when the event occurs. You can download my script files here.

You will probably have to change the paths in these scripts. The files powerlog.sh and battlog.sh should go into /etc/acpi, and the files ac_adapter and battery should go into /etc/acpi/events.

Once you’ve edited and copied to the proper directories, you need to restart the ACPI daemon. This can be done ( on a Debian system),

# /etc/init.d/acpid restart

And your scripts should start logging. Have fun!

For my part, I’ll keep my script running, and see what turns up.

« Previous entries | Next entries »