Thursday, July 22, 2010

Adventures in Prototyping a Board

So I'm working on a reconfigurable programming board for my microcontrollers.  Here is a quick shot of it.


So it's mostly a breadboard in some ways...LOL, but mainly I wanted the ability to have a ICSP connection and I was originally just going to directly connect it underneath to the right pins for the pic 16F913, but decided to just put a header on the other side of the ICSP header and then I can run wire and reconfigure it, as needed. This gives it a little more flexibility, and I don't have to disconnect and try to figure out which wires went where whenever I disconnect the ICSP header from the board.

The benefit to this is now I can program my Pic 16F684, and any other 28 or less pin PIC, I would like to add a power header to the board for additional hookup, but for now this will work I believe, and fortunately I will have the freedom to add to it as needed.

Parts required:
Perf Board from Radio Shack
Headers from Electronics Parts in Albuquerque
IC socket headers from Electronics Parts in Albuquerque
Solder (obviously....hmm wonder if we can come up with a solderless compound....ohhhh I like)

What if you put a lot of conductive material in a superglue form for example, you could "solder" by literally no heat....ok I'm talking crazy. Have a great day.

Friday, July 16, 2010

Setting up my Workspace

I have found that when I have to go to a new computer for work purposes, I have to re-setup a bunch of stuff. I also have scripts that I may have setup that point to drives by letter, maybe not always the best plan, but well I just get used to having things the same way. 

What ways do you achieve having the same desktop stuff setup when you move from computer to computer.

Here are a few of mine:

1. Setting up Shared Drives:

net use /PERSISTENT:yes U: \\drive1\folder
net use /PERSISTENT:yes V: \\drive2\folder
net use /PERSISTENT:yes Y: \\drive3\folder
net use /PERSISTENT:yes Z: \\drive4\folder
2. Registry updates to explorer menu.

3. I make shortcuts and save them on a shared folder on my computer, then just copy them to the desktop if needed.

I have more but they are very specific to where I work so they aren't too applicable to others here. Do you have any other ideas?

Of course these are specific to Windows XP in my case, but heck give me what you have for linux, apple, AND windows.



[Update]
Caleb says.... Remote Desktop..... <- Good call I forgot about that all together, in my case that doesn't really work as well, but for many this is a great solution.

Clearcase: Create A Label with a script

I got tired of looking up how to create a label in the rational documents and rather then going through type explorer, I decided to write up a really quick script. Maybe others will find use in it. Either way if I lose it, it's here for the world to find. It just uses standard commands that are found in the rational cleartool manual.


print "What Vob?";
$vob = <>;
print "What Label?";
$label = <>;
chomp($vob);
chomp($label);
print `cleartool mklbtype -nc $label@\\$vob`;
$asdf = <>;
Now I tried to make it so my context menu would be able to call it, but for some reason I can't make it call my perl script, if anyone has any ideas, please let me know and I'll update.

Wednesday, July 14, 2010

Past and Present 7/14/2010

Well it's been a while, and I better pop back in and say hi. This summer I've been taking Signals and Systems (ECE 314), and am doing an Independent study working on gridlabd with Pacific Northwest National Labs.

I learned a few very important lessons this summer.
1. DON'T PUT SPACES IN YOUR FOLDER NAMES.
2. Focus on one task until completion, jumping from project to project only results in many failed attempts.
[UPDATE]:
3. Test out parts before making them unrecoverable. I made a setup, then used Household GOOP on it to try to seal it, and when I went to use it, it didn't work, and the Goop rendered it useless.

School
I got with a classmate and am looking into working with Cosmiac on my senior project.  I'm not 100% sure what every detail will entail, but looks like a fun challenge, however it sounds like there might be more java involved then I really would like. Of course I'll keep you updated.

Car
Right now I'm trying to finish adding a usb power plug as well as an audio jack to my car, cleaned up finally, and I'm refusing to work on any other projects until it's done. Future plans include reading the CAN bus messages so when I press next on my steering wheel it will change songs on my iPod touch. I do plan on doing a writeup on how I put it all together.

Arcade
I actually finally got a chance to replace my fluorescent light (for the second time), this time I didn't drop the light at walmart before testing it out, now it finally works. Now if only I can finish my other projects and get in here and get it done, I would really like to get an O-Scope, and Logic Analyzer so I can do more testing but anything is possible.

Tuesday, May 18, 2010

Motivation

It's been a while, but then again, it's been a rough semester, I've managed to down 15 credits while working between 44 - 48 hours a week at work, not to mention spending time with my wife. 

So today's topic is motivation, what motivates you? In an attempt to keep each other motivated, one of my buddies and I are going to keep each other accountable. We've decided that for every 72 "failed" attempts at something, we are going to donate $1 per attempt to something we both decide on.

First let me define failed attempt. A failed attempt occurs when we say we're going to try to do something, but either don't even bother to get around to it, or we start but never really finish, I.E. start wiring up the circuit board, but then never finish the circuit.

Obviously we are trying to push past the passive barriers, now there are the occasional active barriers, such as not having parts, or the knowledge to perform a specific task, but we want that to have a minimal impact on such thoughts and ideas.

The way I see it, I have roughly 55-60 years in me left max (who knows I might get lucky and make it longer), and frankly I don't want to waste it. If all I do is watch TV all the time, or sit around and do nothing, what benefit does that give me, I'm simply taking up space, and not accomplishing anything, sure I work, and get stuff done that other people want me to, but I want to accomplish things that I want to.


I'm still learning what keeps me motivated, and how to ramp it up. As I learn what it takes me to do it, I'll stop in and keep updating.

Saturday, February 20, 2010

Pic 16F913 Quick Reference Guide

I wrote a short Quick Reference guide for how I have been programming the Pic 16F913.
Check out the HOW TO here: Programming_The_Pic_16F913_QRG

Good luck and let me know how it goes.

Its should be pretty straight forward.

Wednesday, February 17, 2010

Emulator

Well I finally came up with a good project for my ECE 335 course,

I attempting to write an emulator for the Power PC 403 for the Microprocessors course ECE344, I was wishing the whole semester for the opportunity to have something to test on at home, so when I came into school to test on the actual boards I'd be able to know that my program would work as expected.

In keeping with ECE 335 I'm sure I'll write some "terrible" code without realizing it, at which point, I'll just go ahead and optimize it, this will have to be a really quick deal so initially I'm only going to support the addi command. Once that is up and working I'll reassess what is going to happen next.

The link to the project is here if you're interested in helping let me know.


Thursday, February 11, 2010

Counting

This is the VHDL for the counting algorithm from ECE 528 today.



Monday, February 8, 2010

Finding Bugs

So I was working with a buddy on a program he wrote in Assembly, he had nearly the whole thing complete, and before he's able to actually test it, he did one of the smartest things I can recommend if you can't actually test the code until some future date.

HE ASKED SOMEONE ELSE TO TAKE A SECOND LOOK.

Better then just asking someone else, asking someone else who has a better, even if it's slightly, knowledge of the subject, can see things that you might not see.

Now sure sitting in front of the computer with the board next to you and assembling, loading, running, then going back to debug can gain you some invaluable troubleshooting experience. I won't lie to you, learning how to attack a problem can be invaluable, but one of the biggest key's to do that follows.....

The key for the second person here, is to guide the programmer to the problem spot without giving away the answer if they know it.

Why so? By forcing the person to look at the code EXPECTING a problem they're going to start analyzing each and every line, Is it the right command here, did I set that up right, did I move this pointer to the right spot. EVERY LITTLE DETAIL should get scrutinized by the programmer. And that is good, they'll learn TONS and begin to see the big picture here.

Once you code something up, re-read it, re-read it again, now compare it to your design.

Wait a second I snuck something in there didn't I?

It comes back to design huh. IF every piece of the code you wrote can be traced back to a design element you wrote, you can break the problem, if there is one into a tiny piece, and that's a huge factor when you're working with 1k+ lines of code in assembly.

It might not seem to make sense working with a 50 line piece of code, but if you can force the habit it will make you a better programmer. I promise!

Sunday, February 7, 2010

The PIC 16F913

So I bought some PIC 16F913's I was hoping I could just literally plug in the PIC to the PicKit 1 and just program, turns out it's not that simple, but aside from hooking a couple wires up, well frankly it's not that hard. I just wired up the appropriate VSS, VPP, VDD, and ICSP Clock and Data lines.

One thing that threw me off, is that the microchip site said that the PicKit 1 programs the P16F913, this isn't "entirely true" I was able to use ICSP. Since I can't get MPLAB to program via ICSP, I was able to using the PicKit 1 Classic program, found on microchips website.


Here were my steps:
  1. Hooking up the ICSP. I actually tried to do a "read" with the PicKit 1 Classic S/W, it recognized that it was a 913 AWESOME, this is really good news.
  2. Load up a program into MPLAB and compile, turns out I was able to use the exact same "hello world" code from my 16F684, so I just compiled and was ready for the next step.
  3. I then pointed to the hex file compiled by MPLAB, from within the PicKit 1 Classic program.
  4. I just hooked up the appropriate pins to the LEDs on the board to make sure i was able to turn the LED on and off, if the S/W was working as I expected.
There you have it, it wasn't nearly as hard as I expected it to be, now that I can use the PIC16F913, well frankly I am pumped, the only thing I would really like to do is have a socket plug that I can use to directly wire up a ICSP port, then I can really just use a ICSP plug on any device/board and I "think" I can actually use it.

Next up is maybe serial communications? We'll see the sky's the limit now.

Friday, January 22, 2010

Networked memory

I just read an interesting article about how slime mold generates networks as efficient as the Tokyo Subway system, the only downfall looks to be related to redundancy.
Slime Mold Subways

Which get's me thinking, now that memory is a dime a dozen, can we have networks of the same data, and depending on where you are in the platter for example rather then having to travel say all the way across the platter to get the information, you can just stay in the local vicinity?

So Suppose you have the same data being transferred back and forth in different memory regions so they are all matching. Your head is already in a particular location of the platter, now rather then having to say move the head all the way from where it is to a location nearly opposite the location you currently are, there is a networked memory piece just a few micrometer's next to, or after what you're looking at. Now the disk doesn't need to seek as long, which tends to be the more time consuming part of data access.

Let me know what you think or do you think I'm off my rocker?

Monday, January 11, 2010

Deleting Files

I was having problems with a particular file, one of my scripts accidentally produced a file named such that I couldn't delete it.
I found a great tip here: Forum Post

All I had to do was find the filename using dir /x /a

Once i found that a simple del filename got rid of it.

Saturday, January 9, 2010

Analog Inputs

I've been fighting since late last night trying to get analog inputs working on my PIC16F684.

I finally got somewhere this evening, oddly enough for some reason, in some regions of the pot it goes really quick then just a small bit over will slow it down drastically.

All my code does is initialize everything to setup RA0 as an analog input, then it turns on the ADC waits until it's done then toggles the LED and waits the amount of time in the combination of ADRESH and ADRESL, all I had to do was put ADRESH into the integer value I had, shift it 8 positions left, then or the ADRESL in, then pass it to my wait routine.

Outside of that it's finally working, the last hiccup I had was well frankly I forgot to turn it back on after trying turning it off as a troubleshooting measure. Of Course I'll continue to plug VERSION CONTROL, had I gotten this working and decided to play a little here and there to make it say be more sensitive, I may have done myself in by messing something up, now I have no fear of that.

I am posting the code on my SVN server, and one day would like to be able to make that public so everyone can get to it, but I suspect my ISP won't like me using a web server out of my house, so I'll for now plan to upload it to Google Docs.

Below you'll find the vid of the PIC Kit 1 in action with the LED's toggling quickly then as I rotate the pot it slows down.


Here's the code to do it, there may be some unneeded stuff, let me know if you see anything off!

For the sake of testing I uploaded this file to YouTube and am going to see what the difference in appearance is here!


Thursday, January 7, 2010

Opening Mailto in Gmail in XP

One of the first things I did when I bought my netbook was to download chrome. Now I haven't actually clicked a mailto link until today, and guess what happened? Internet explorer in all it's glory opened up. I didn't like that. One of the solutions I found was to look for URI.mailto or something to that effect in the file types menu of an explorer window and make some changes there, but well I didn't like that method much and I couldn't find what they were talking about in the first place.

I started searching for the term mailto in the registry, and I came upon this line right below.

HKEY_CLASSES_ROOT\mailto\shell\open\command

Unfortunately I deleted the original line so if anyone has it I would really like to know what it originally said, but none the less I have the line to insert if you want Chrome to open up gmail and insert the mail address!

This brings me to my next point ALWAYS BACKUP YOUR REGISTRY in case you muck something up.

I changed the key
to the below (change out onaclov for your username) and you should be set to go! Of course if you want to use another type of email client and/or browser you're going to have to change a few things. Basically all I'm doing is calling the chrome application, and passing the gmail address with mailto and URL %1 passed to it. The ideal way would be to call the default browser

"C:\Documents and Settings\onaclov\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --app=https://mail.google.com/mail?extsrc=mailto&url=%1

Additional Notes:
Oddly enough I found that if I go to IE and click options and then programs it only shows Outlook Express and Windows Live Mail which I initially thought was the culprit and in some ways it might have been, so I did a search for Windows Live Mail.

I found this:
As you can see it looks like mine has an entry for GMAIL, which of course is completely incorrect
as I was testing some things out trying to get it to work, if you add a Key there and name it whatever you name it, when you go to IE and Tool Options and Programs and Email you'll see those entries the problem is I have/had no idea what to put in there which lead me to the initial piece of the post finding mailto.

If I had the original mailto contents I "might" be able to remember what that was doing and possibly setup the entry on the left (HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Gmail) to actually open whatever browser you want as well as whatever email client you want based on that location (rather then having to keep entering in the registry if you decide to change).

Well if you have any other items of note please let me know.

Good luck

Wednesday, January 6, 2010

Interrupts

In ECE 344 we learned about interrupts and how to use them, of course we were programming in assembly, so we had to setup our interrupt vector, then write some code at the appropriate offset.

That turned out to be pretty easy, but the problem is let's say we want to write some code in C and try to handle interrupts. This is a little tricky if you don't have all the information you need.

Well of course since I can't seem to think logically sometimes, I didn't look at any manuals and just headed over to stackoverflow.com, where I got some great answer's here: Interrupts

The simple answer was this:
void interrupt my_interrupt_handler (void) {
handle_interrupts_here();
}
I did some testing and once I had the right bit's turned on I just ended up in my interrupt routine with this (about 90% borrowed from here:Microchipc):
void interrupt isr(void)
{
if (T0IF)
{
TMR0=TMR0_SETTING;
T0IF=0;
RA5=1;
//code right here is executed every 800us
}

My newest project I'll be working on with this microcontroller is to find some way to create a simple serial interface which I can transmit and receive a piece of data. Since I can interrupt on a timed interval. I should be able to read data passed at an expected rate.

I'll keep you updated when I get more work done.

Sunday, January 3, 2010

SVN

So today I would like to go over the importance of version control.

Take for example I was working on a program, I made some changes and it was working. Now rather then checking in my file and version controlling it, I just started modifying it. About half ways through I realized I meant to re-save the file somewhere but instead overwrote the changes that I had originally working.

When you've gotten a particular program working at some point, if you're dedicated enough to stick to version control, you check it in, then keep working, now if you have made changes and wish to revert to a previous working state it's REALLY EASY. Now of course simple enough you can just save multiple copies of a file, and keep renaming it and everything else. If you use version control you really only "see" one file and you just keep checking it in.

I have SVN setup on my server, and am using Tortoise SVN for my window's machine, and am enthralled with it. When you do a checkout in SVN it ends up copying the checked out folder into your current directory. Now when you make changes it shows a different icon on the folders so you can visually see that it's needing to be committed. Now if you're working with multiple machines/people you will want to make sure you update before commiting.

Once you've committed changes you're set.

Good luck and let me know if you need any help setting up your very own SVN server.

Max RPM II

Well I finally got a few minutes to mess with my arcade after cleaning the garage a bit.

So far I have the lights on the coin op working, the flourescent light doesn't fully light, so I need to find out if it's the wattage or what. The monitor doesn't turn on at all, and the speakers just give a hum. I have to assume that the system isn't "booting". I found a site I can use to help me with questions here: Arcade Museum

I have 120V going to my monitor and have checked a few IC's on the Turbo Cheap Squeak.

In the hopes of using another computer monitor I tried hooking up the Horizontal sync to a regular CRT, and the monitor said the frequency wasn't correct. So at this point I'm assuming that it's a no go on that CRT.

I'll post updates as they come along. Have fun!

Thursday, December 31, 2009

Timed Shot Photos

So my original goal for this project was to take some pictures of the mountains at pre-determined times. I found that this might be useful in other cases as well, so I'm going to be building an enclosure next and allowing maybe a tripod screw mount.

S/W Requirements:
1. Set a period (eventually elsewhere, but for now in code)
2. Turn Camera on
3. Once camera's stabilized take a picture
4. Turn camera off.
5. Lather, Rinse, Repeat.


Here's some footage.

Tuesday, December 22, 2009

What is a web browser?

In commemoration of my 100th post, I decided to do a video post. Here I give a rough overview of what a web browser is. I'm sure it'll need more work, but hey it's a first and I just put it together with movie maker through windows.

The inspiration for this post was my mom, I was attempting to set her up with Google Voice, and when I was needing to get her to get on the internet she asked me "You mean click aol?". Unfortunately I suspect very strongly that my mom thinks that aol is the internet, and there are alot of people out there that think the same thing. Sit back relax, and hopefully I'm at least somewhat entertaining.



Once you've finished watching let's re-iterate what I'm trying to get across.
1. Web browser's are not the internet.
2. Web browser's are the vehicle that get's you to web pages.
3. You aren't stuck with only one web browser, you can try other ones.
4. Things you want to keep in mind are speed, real estate, following standards, usability, popups, and addon's.

Tuesday, December 15, 2009

Help Joe get an iPod touch

I posted a site joe.onaclovtech.com, hopefully I can get alot of people to donate a little, and we'll all get Joe an iPod touch.

Thanks anyone that helps out.

#joesipod