Spring Cleaning

Every year, around the beginning of the year, I have the tradition of doing a little "spring cleaning" on my computer(s). Usually, that means I send all newly gathered photos, music, project schematics, and code to my external drive in preparation for a clean drive and a fresh instalment of the current (or new) OS. This year, however, fate decided to kick-start my cleaning by destroying my drive before I could back anything up. When I purchased my laptop in 2013, I opted to include the shiny new 120GB SSD. After some light research, It appears that (solid state) drives from that era had a life expectancy of a whole year. I'm guessing that's including certain extremes, but still.

Let's rewind and talk about the mental terror the drive failure put on me. I had no way of knowing it was the drive, the motherboard, the SATA port, nothing. I have no other mSATA devices to test. Furthermore, the timing of the crash was way too coincidental; It happened as I was replacing the digitizer (which had cracked a few months prior).

So here I am, working on the LCD. I get it all back together, and reboot. everything's working alright, then...

nothing.

The system comes to a halt. No response. Keyboard yields no effect, the only thing to do is a hard shut down. After that, it boots with the generic drive failure message. I boot into BIOS, and I see the painfully vague "Not Detected" under the SATA field.

"Not Detected"?! 'The hell does that mean?

I unplug the drive, reinstall it. nothing.
Try reinstalling the OS via liveUSB. nothing.

Now, my computer's telling me it's "not detecting" my SATA drive. After researching and weighing out my options, I eventually order a new (SS)drive off Amazon (since my local BestBuy didn't carry/know what mSATA was).

For a week I think I destroyed my laptop by electrostatic shock or something, retracing all my steps in my head over and over again.

The drive comes in, I Install it, and I'm back in business.

I attribute the failure to pure coincidence. I was working on the LCD, and didn't touch any other component of the motherboard. Still yet, the timing was awfully strange.

While I am glad it was the drive that failed, and not the motherboard, it is bitter sweet. I had a years worth of code for an Atari project I was about ready to show the world on there. Oh well, lesson learned.

It appears a lot of companies have stepped up their game on SSD endurance. I went with the Samsung 850 EVO. It's rated to last five years with 40GB read/write daily (cnet). That's pretty good seeing as I'd never write 40 gigs a day (Samsung also offers a decent warranty as well).

Things to take away from this:
  1. Back your mess up. Frequently.
  2. Back it up some more.
  3. Do your research when purchasing new tech.
  4. Go ahead and back up your files again.

Three months, sheesh...

Time flies when you have none.
Update soon!

Automating assembly for the Atari VCS

Just for the sake of a new post, here is a quick and dirty script to automate the processes of assembling a file from source for the Atari VCS and keep everything organized. This assumes you have WINE installed as it makes use of a Windows binary because I'm too lazy to track down and compile the source for Linux (at least I'm honest). This also assumes you have the folders arranged and named in a similar fashion, the tilde represents your folder's paths, blah blah blah. Ok.

#! /bin/bash
#auto dasm
#matt henderson
#2014
export DISPLAY=:0
clear
echo "Auto DASM/MakeWav"
echo "================="
echo "Input (*.asm) files are read from 'asm_input'"
echo "Output (*.bin) is sent to 'bin_output'"
echo "List files are sent to 'list_output'"
echo "Wav files are sent to 'sc_output'"
echo
echo -n "What is the name of the *.asm file? "
read input
cd /~/projects/atari2600/assembler/dasm
./dasm /~/projects/atari2600/asm_input/$input.asm -l/~/projects/atari2600/list_output/$input.txt -f3 -v5 -o/~/projects/atari2600/bin_output/$input.bin
cd /~/projects/atari2600/assembler/makewav4.2
wine makewav -ts -d2 -f0 /~/projects/atari2600/bin_output/$input.bin
mv /~/projects/atari2600/bin_output/$input.wav /~/projects/atari2600/sc_output
clear
echo "Auto DASM/MakeWav"
echo "================="
echo
echo "Run '"$input"' in Stella? (lowercase: y/n)"
echo
read stellarun
if [ $stellarun = "y" ] ; then
    cd /~/projects/atari2600/bin_output
    stella $input.bin
else
    clear
fi

There, nothing special at all, but it saves a lot of typing (as I mentioned, lazy). Also, to avoid having to navigate to the script's folder and typing any prefix to execute the script, you could append the following to bash's rc file (/etc/bash.bashrc) and have the script act as a globally accepted command (I've chosen "asm").

alias asm='sh /~/asm'

  Don't forget to logout/login in order to use the new alias for your script.

Slow production and a major change

I don't really know when I last made a post on here, unfortunately. I ended my "break" from school (break equating to about two years) at the beginning of September, and along with that came a change in my major. For my day job I am a pharmacy technician. I've been doing it for just under six years and have seen the industry (at least in my region) change dramatically. Things have morphed in such a negative way, it made me realize I no longer want to pursue a degree as an pharmacist.

But I digress.

I've always been interested in electronics. Everything about it has fascinated me every since I first started taking apart my toy radios and walkie-talkies as a kid. When I got a bit older, I loved putting things together to create new uses out of them. I recall building "a robot" out of what was pretty much DC motors and Lego bricks stacked onto a remote control car.

But I digress.

When I started college the first time, I began working towards what would ultimately land me a job as a pharmacist, all the time tinkering with small electronics and researching things of the like on my free time. Fast forward five years and I realized I didn't really have a real reason for wanting to work in a pharmacy for the rest of my life. Hell, I couldn't even come up with a reason why I continue to work where I do for reasons other than a pay check. That's about the time I took a good hard look at where I wanted my life to go. I'm a few months shy of turning a quarter of a century old (that's a bit dramatic), and I realize that I'm still quite young, but also getting into the age where I need to be on a set path. Otherwise, I'll be working aimlessly through a job/jobs that I really don't care about just to make a buck.

So anyway, I changed my field of study to Engineering. It's pretty broad, but I'd like to end up getting a degree in something more specific to electronics or electric.

better late than never.



PS: I'm still messing with my Atari here and there, but my classwork keeps getting in the way.

Tight fitting Atari carts and how I got around them. Pt 1

All puns aside, sometimes a tight fit can really make things difficult. As I've said before, one of my favorite hobbies include messing around with my Atari; this includes steadily collecting games I've already tried through emulation to play on first-party hardware (because, lets be real for a second, there's no replacement for the original). That said, one of the best games I've played on the 2600 is Jr. PacMan. I was happy to find a copy of it that didn't look too warn on eBay, and received it just yesterday. I opened the package and (attempted to) pop the cart in only to find it didn't fit. At all. Ms. PacMan was a tight-as-hell snug fit, but Jr just wouldn’t budge. After a quick search over at atariage, I came to find out that some "red label" cartridges do not fit in older models of the console (not sure why, didn’t really care to be frank). My first thought was to modify the cart, then the console, but both ideas were quickly tossed in favour of building an extension instead.

I had a few parts left over in my bin, so I grabbed a board from a PacMan cart, and an edge-board connector and got to soldering. What follows is a quick mock-up for testing.




 Now I know it works, I'll redo it using a smaller gauge wire and fit it all into a cart (or some kind of enclosure) that will fit smoothly into my Atari; this way I can play any game, unmodified.

Focusing on the software side of things...

So I decided some time ago to "get back to basics" so to speak, and brush up on how things were done in the old days... like, 1975. I got a book on early microprocessors and TTL logic and did some reading. I had to put it down for a bit (life gets in the way sometimes), but I've decided to pick it back up again.

I probably shouldn’t, but I'm also studying up on some assembly language. Since I'm already going back to the "beginning", I figured I'd keep going and try and learn to program the micros the way they were originally.

Conveniently, this ties in with my experiments with the Atari VCS. The homebrew scene is surprisingly active, and a lot of people still program games using 6502 assembly. I'll be using the DASM assembler to put a program together and test it out with the Stella emulator. Once I have that mastered moderately understood, I suspect I could move on to AVRs.

So that's that. I just got DASM working again (transitioned from Windows to Linux), so now I can actually get something done.

Adding Bluetooth to your car/home stereo for $7

Here is a quick afternoon project to update your stock tape player/auxiliary input in your car (or home) stereo. I did this with some free time yesterday afternoon, and it only took me about an hour (including wiring in an additional power source).



Let's get started. First things first, if you have an Aux-In on your deck, you can skip this set. If you have an older vehicle like I do, tape player adapters can be had for peanuts. I think I got this at Target about a year ago, and it works great. Some will argue the sound quality isn't worth it, but I find it is just as good as some CD players by comparison.


Pro tip: Here is a shot of the inside of the adapter. I took it apart about a week after purchasing it because I noticed a terrible squealing noise coming from the tape player. I know most tapes emit a noise, but there is no tape actually being spooled up/down, so there was no excuse. I removed all the gears, and bam, the the only sound coming from my radio was my music. The only reason I can think of as to why they even put the gears in there to begin with is- and im just guessing- maybe some tape players require both spools to rotate at the same rate, just as it would if there was tape being transfered back-and-forth. So make note of that possibility before dumping the gears; thats why I took the picture in the first place (to reference).

 

Ok, now we have a clean source of input to our deck, but this isn't 1998, we don't need wires all over the place. Here is a screenshot of just one of many bluetooth receivers. This is what is going to be doing all the work. As you can see, it costs very little, so I was willing to take the gamble if it didnt work, and considering range wasnt going to be an issue, I figured it just might work out (first impressions on quality at the end). 



The setup is straightforward, there is a standard 3.5mm audio input at one end of the dongle, and a male USB connect at the other. Plugging the USB to a power source (i.e. cell phone charger) powers on the device, and begins listening for a bluetooth source (as indicated by a rapidly blinking LED). Once paired, and every time you power on the device after, it will act like any other bluetooth speaker/headset and begin forwarding the source's audio to the device (then to the 3.5mm output). Simple as that.

Thats it. All that is left now is cleanup. I like to keep things tidy and hidden; I could have settled for having the audio cable hanging from the tape deck, and the bluetooth receiver plugged into the only outlet in the car... but gross. Not to mention it would kinda defeat the purpose here.

Routing the cable behind the bezel require very little extra work, and makes all the difference in appearance.


Audio input routed under and inside the center console.


Bluetooth attached to a car charger, attached to a 12v outlet. I wired the outlet to cut it's power when the car wasn't running, since there is no off switch on the dongle. (Yeah, that's electrical tape. Yeah, I'm gonna replace it with butt connectors.)

Everything bridged together...

Tidy up the console

 
All done.


There you have it. With very little effort and very little cash you can add wireless connectivity to any stereo that already has an auxillery (3.5mm) input or accepts tapes. Now, It looks like there is enough room inside the hollowed out tape adapter to house the bluetooth receiver (without it's case), all that would be required then is a power source which would be easy enough, but I was going for simplicity here. Maybe another afternoon...

Notes on quality:

 Don't expect bose or beats quality here, it is $7 after all. That said, the highs are great, the mids aren't bad, and the bass is... there. You'll want to tweak the equalizer on your source, and if it's a phone, go ahead and look into getting an equalizer app; that should solve issues there. After tweaking the levels on my phone, it sounded just like it did when it was hard-wired to the tape deck- A.K.A great. If you're adding this to a hi-fi system, you probably wont need to do anything different. I already had mine going through a seven band EQ, so bass wasnt really affected.