The present is the shadow of the future…

Posted on by k-livin | Leave a comment

Serial Output From Any Pin

I went to the hacker dojo last night and met some guys that gave me some good debugging tips that I am putting to good use in my project. I had an insanely ghetto way of debugging the soldered atmega. I was using 2 LED debug lights to signify when certain things happened in my light. It turns out (thanks random hacker dojo guy) that you can actually hook up any pin of the soldered atmega to an arduino running a serial debugger program like SerialSoftwareExample from the arduino example library. You just set the RX and TX pins depending on who you want to read, and who you want to transmit.

One interesting thing in doing this is you have to connect the ground of the arduino to the ground of the rest of the circuit, which makes a lot of sense that they all need a common ground. It’s only when I did this that I noticed the radio seemed to be less noisy, but was still receiving invalid messages.

In fact, the radio would receive button presses even though the remote was incorrect. I need to do a couple things:

1) Solder a debug pin to the remote atmega to attach to a second Arduino.
2) Remove the second, now unnecessary debug out solder from the led atmega.
3) Change the button press values to something that doesn’t start at 0 to avoid getting a noisy message that happens to be 0. It seems to be receiving NULL messages in some conditions where there is some noise on the antenna, so this is a bad value for a potential message.
4) Print the initialization data of each radio to make sure it is initing properly, and then determine if the transmitter radio is actually finding the receiving one.

Also, I have a new couple items to progress my little Arduino Hobby to the next level…

Saleae Logic USB Logic Analyzer

This little guy will help me track what pins are doing what, while printing the serial out all in one nice setup…I here the software for it is beautiful as well.

Secondly, this would have saved me so much trouble:

http://www.taydaelectronics.com/hardware/prototyping-boards/small-stripboard-94x53mm-copper.html

Just use a drill bit to scrape away the copper plating that you don’t need. I am gonna buy 20 of these bad boys!!! Taydaelectronics has great deals by the way.

Posted in Arduino | Leave a comment

Test plan

The last thing to get working is the RF receiver on the back bike light, there seems to be some poor connection or possibly things have been mis-wired.

Here’s the connections from the RF24 to their respective arduino pins:

Arduino Pin Radio Pin Radio Pin Label
9 3 CE
10 4 CSN
11 6 MOSI
12 7 MISO
13 5 SCK
- 1 GND
- 2 3V3

And here’s the actual schematic of the rf24 radio:

Nrf24 pinout

Pinout for the nRF24L01

I will have to remove the rf24 and the atmega chip and connect a wire in on the radio pin and a wire out on the corresponding atmega pin. I’ll connect it up through a LED or something to show that the connection is good, and I’ll go through each pin to determine that the pin-out is exactly as I have specified.

Posted in Arduino | 1 Comment

One major problem – solved (I think)

Well, the plan worked, I noticed that I am actually using wrong components for one part of my atmega setup.

I was using capacitors labeled “104″ on the X1, X2 timing port that were incorrect.

I need to be using capacitors labeled: 22 pF

What is “104″? Turns out 104 is 100 nf or 100000pf….so I was only off by a factor of 4-5 thousand, no big deal (_?_)

Here’s the capacitor reference I used:
http://www.csgnetwork.com/capcodeinfo.html – Capacitor code guide

I am not sure what a difference that actually makes in the electronics of the system. Maybe I’ll look into figuring that out when I get the time.

Now, all that’s left to do is swap out the capacitors and all should be groovy right? RIGHT???

Posted in Arduino | Leave a comment

Troubleshooting atmega

I have been really struggling to stay motivated on this bike light project. Mostly because the troubleshooting process is so painful and tedious.

I started to organize my connections before I solder them more clearly. I have even started to label the pins on the PCB card itself. Here are my connections to the back bike light atmega for clarity:

My back light project does not even run after adding some debug lights on pins 2 and 3 after my init:

The last thing I am checking before I start over completely on the back light with a brand new proto board is to double check the crystal on the baord is connected correctly. I have additional atmegas for testing on a breadboard and I want to verify that I can get through the full setup by seeing the debug pins light up.

If it works with the same components that I have already soldered on the board, I’ll be confident I found the problem is with some impossible to find connection on the board…there’s too many connections at this point, and I might as well start completely and will incrementally put together and test fewer components at a time.

Here’s the basic atmega on a breadboard setup tutorial i’ll be repeating:

http://arduino.cc/en/Main/Standalone – Arduino on a breadboard tutorial

Posted in Arduino | Leave a comment

Diff Directories Bash Script

I keep having the need to diff directories at a time, and if differences exist, print the diffs with a few lines of context. Here’s a quick script I made that accomplishes what I need:

Posted in Scripting | Tagged | Leave a comment

Saving mutable things to NSUserDefaults or keychain services

When saving an object in user defaults, the objects must be plist objects.

Property list classes are NSDictionary, NSArray, NSString, NSDate, NSData, and NSNumber. You can write mutable subclasses (like NSMutableDictionary) to user defaults, but when reading the objects out, you will get the immutable subclass.

If you want to mutate the objects in userdefaults (and as it turns out the keychain services) you will need to convert the return object to something mutable as in:

Posted in iOS Development | Leave a comment

Mountain Lion security “enhancements”

I recently got a mac pro retina and upgraded to Mountain Lion. I was trying to install subversion on my new machine. When I go to install Apple asks me a security question I have not seen before. This is the first time seeing this message when I go to install it:

It seems as though apple has added new security measures in mountain lion on certain software distributors. Of course you can bypass the message easily by holding the ctrl button down while selecting the file.  Then it will ask to confirm that you are installing a file from one of apple’s “non-friend list”.

In addition the svn provided by CollabNet was broken for Mountain Lion, and would not install. I don’t like that you have to register to these svn distribution companies to gain a set of open source svn binaries.  Apparently that’s how svn is distributed these days.

subversion install not working in mountain lion

Others have ran into this issue and suggested downloaded command line tools from Xcode 4.4 from preferences->Download

That worked like a charm for me!

Here’s more info on that:

https://answers.atlassian.com/questions/72981/error-after-upgrading-to-mountain-lion-os-git-svn

Posted in All things Mac | Leave a comment

Universal Musings

I got into sort of a pondering mood, and I was trying to decide the shape of the Universe as best as I could imagine. These are the things that keep me up at night, so I might as well get them out there.

What do I mean by the Universe as we know it? Well, I am thinking of just the system of galaxies, black holes, stars and whatever density of substance there may be in our current volume space and time. I feel that parts of our universe started from a point or a big bang type of thing. But maybe, just maybe there are other parts of our universe that existed all along, far far far before our “universe” ever came to be. Sort of like a powerful field that flows through our universe, and probably through our time. In fact, I often feel I have this deep feeling and connection with a greater power of some order that has always existed, has more intelligence than I could ever perceive, and has a deep curiosity and attraction to each cell of our body and each star in the universe. I am not naive enough to think that because I see think, see, and feel order, that means there absolutely has to be order (for all those chaos theorists, and quantum theorists out there), but coincidentally (rather purposefully) enough, that’s really likely to be true – the order that we perceive to be real, is in fact real and bigger than we can truly see in our current limited technology.

Other things that keep me puzzled is the orientation and spin in black holes and/or galaxies. Does our galaxy (the Milky Way Galaxy) and every other galaxy for that matter have a common axis in any one direction or do they flow on some interesting curve? I haven’t gotten any positive answers on that. Also, I wonder if it would be hard to plot the orientation of all the galaxies we can find, and examine them for any similarities, or patterns? The only thing that would really shock me is if there was no pattern at all to the orientation of galaxies and black holes.

Posted in Science and Theory | Leave a comment

Test Gallery

And this is the Gallery layout for wordpress blogs

Posted in Random | Leave a comment