Custom Search

Category Archives: software

MSP430 tools for linux

0
Filed under electronics, General, Hardware, Linux, OS, software

For your MSP430 launchpad to work on Linux you may have to do a little work, lol hopefully you expected this…..So lets get to it…..by the way i have Ubuntu 9.04 for my system, but that shouldn’t matter, except for dependencies may be different then mine.

First you will need a few things to get it all working, so gather your tools and programs and lets start…..

  1. launchpad with 430 value line chip
  2. http://mspgcc4.sourceforge.net/ you will need at leas the binaries, or you can build it yourself
  3. http://mspdebug.sourceforge.net/ this is the program that will let you program your msp430 launchpad and debug it if needed
  4. libusb dev files (usb headers for compilation)
  5. Readline dev files
  6. and texinfo dev files

after you have gathered all that you need you can start installing, you will most likely need the CLI to do most of the work, since we will be moving files into a root owned folder.

  1. First Build or install MSP430-gcc and other binaries for the tool chain http://mspgcc4.sourceforge.net/
  2. next install or copy the binaries /usr/ or usr/local ( i choose /usr/) I unpacked my archive inside my home folder and then CPd(copied) everything into /usr/ folder
  3. then check to see that they work, run msp430-gcc or msp430-gdb, it should just give the usage or start the program if all went well
  4. Now you want to install mspdebug, this program allows you to connect to the launchpad and reprogram the chip or debug it . It should be the simple make && make install on the source and it should go fairly quickly. if you have dependencies issues please consult the maintainer, I only listed the ones that i needed to download.
  5. after its done installing run it and test. to run it type “mspdebug rf2500″ and it should start up
  6. jsolarski@server-001:~$ sudo mspdebug rf2500
    [sudo] password for jsolarski:
    MSPDebug version 0.9 - debugging tool for MSP430 MCUs
    Copyright (C) 2009, 2010 Daniel Beer
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


    Trying to open interface 1 on 005
    Initializing FET...
    FET protocol version is 30066536
    Configured for Spy-Bi-Wire
    Set Vcc: 3000 mV
    Device ID: 0xf201
    Device: MSP430F2013
    Code memory starts at 0xf800
    Available commands:
    = erase hexout mw read run sym
    cgraph gdb isearch opt regs set
    dis help md prog reset step
    Available options:
    color gdb_loop
    Type "help " for more information.
    Press Ctrl+D to quit.
    (mspdebug)

  7. now that it is connected its time to try and reprogram the flash, or play around with the registers.

Now that its hooked up and ready to go you can go ahead and play around with mspdebug, or connect it up with gdb to debug and reprogram as well, but im just going to go into mspdebug because i have not learned gdb as well as i should.

The main commands for mspdebugare

=        erase    hexout   mw       read     run      sym
cgraph   gdb      isearch  opt      regs     set
dis      help     md       prog     reset    step

the ones that i have used so far in my learning this program

  • dis <address>< length> — disassembles that block of memory dis 0xf800 2048
  • prog <file> program the target board “prog main.elf”
  • md <address><length in bit> read an address
  • regs    displays your registers for the board
  • erase   erases the flash memory of the board

There are plenty of other things you can do in mspdebug but that is beyond my knowledge at this point.

To reprogram the board just follow the simple instructions of  erase, prog. simple as that.

Personally the easiest way to reprogram it is use this archive, which has all the files needed to do a test reprogram …and its been edited so it can be compiled with mspgcc.

Demo program that works with GCC and mspdebug and msp tools

this is the same source code and make file found on This site. I have not modified it all i did was take the .tgz and package it up into a zip file so its an archive with in a zip file. this is the same program that’s on the 2231 chip that comes with the launchpad except a few changes to make it work with gcc.

At this point you should have a good starting point to work with this chip…just a little more research and i should be able to creating programs that do what i want them to do….

Hope this helps!!

MSP430 launchpad dev kit how too

Filed under electronics, Hardware, Linux, software

A few weeks ago I had purchased a few MSP430 Launchpad, originally from Mouser, but there wait times for shipment of the product wasn’t until mid AUG to SEP

and decided that was unacceptable for my terms of getting product and or waiting for parts…..very few times have i waited for more then a month for anything that I wanted, Sugru was different so I waited for it…..but back to the MSP430.

after searching around I found a company that sold it and was in stock, so i Decided to cancel my other orders and go with them, the company was Newark, and i was very happy with there customer service….very friendly and polite. but i have finally gotten it and was able to do a little testing but not much in the way of programming, I haven’t set up the software for it or the library’s. But i did get to solder on the 32KHz crystal that was sent with the board………to my surprise it was a SMD 1.4mm+-.1mm crystal, with the leads .5mm apart from each other. I saw this and wondered why TI hates us hobbyist. I was expecting a regular through hole crystal, like they showed in one of the videos but that’s not the case, so i will do my best to solder one on to the boards and connect all the headers. I chose the regular female headers, sorta like the arduino, and i left the other board blank so i could solder wires and add other interesting gizmos to it and also to have a board that relies on the internal oscillator. so back to the how too……. Installing the crystal is probably the hardest part of the whole kit, just because the crystal is so small and hard to handle, but if you do it smart you can solder this piece in no time flat. So lets begin with things you may need

  • Supplies
  • Launch pad
  • 32KHz crystal
  • soldering iron
  • solder
  • headers
  • Bright lamp
  • electrical tape or tape like substitute
  • odds and ends (lol)(tweezers or other tool for manipulation)

after getting your supplies ready its time to start plugging stuff in and getting things setup

Read More »

BPM Counter Display update

0
Filed under arduino, electronics, Hardware, software
Tagged as , , ,

I finished the display for the bpm counter!! Its amazing what you can do with a few transistors.  I’m currently using 10 of the 14 digital pins on my board, but running three 7 segment LED displays.  Parts include 10 NPN 2n2222 transistors and NPN 2n3904. 7 x 3.7K resistors and 2 dual 7 segment displays (only 3 being used).

Thanks to Codekiller, im going in a slightly different direction, he suggested to create a VU meter first and get a good reading, then start to create the algorithm to find out the bpm is. Timing will be essential to get an accurate calculation, and also to visually look at the graphed data the arduino puts out will help in creation of the bpm algorithm, from my experience in audio editing and mastering, I am pretty certain I can pick out the Beat and measure the time it takes for the next peak, doing this visually should not be to hard but putting it into a programming language and having it work may be a little challenging.

I am currently coding a quick gui to read and graph the values using The processing programing language(very easy to build visualization software and gui interfaces using a C like programming language). This may turn into a start of a simple oscilloscope later this year since i do need one for my bench.

Pics comming this morning when  I get home from work(lol)and maybe a video if i can get it to work correctly. I am so happy that I have a radio shack within 5 mins from my place, and only have to wait till 9 am till they open.

Thanks Codekiller for the great help and ideas—> his site http://smfinc.web.elte.hu/ruckus/index.html

and the site Im using as a starting point —>http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/

at the time of this post the last link had a Database connection error in German, I will check in a day or so and if its still down, I will post the PDF and code that I’m using from there project.

Look for more updates Soon!!

Justin

update-

my camera is not function at this moment, im working on getting it fixed and recovering some of my pics, but work is continuing on my days off. (not to much time on work days) the audio circuit is done, just need to test .

I hate slow DBs

0
Filed under General, software
Tagged as , ,

Have you ever called a place that needs to look up your account or other info? ever notice how it takes about a some time for them to get that info?

I’m the guy on the other side of the line waiting to get that info so I can help fix what ever problem they had called in with, and the longer i work the more i notice that its taking longer and longer to for me to pull up any info about any account. So whats is the deal, why cant a multi billion dollar company fix a database?

We live in the Age of Information, where almost everything is instant, where people expect info or help to be provided to them that instant. My guess is everyone at my place of employment probably don’t even notice the long waits between DB queries through our ticketing system. So how long is long? well i decided to test this, for a basic customer id I queried takes about 20 seconds, ok thats acceptable but thats only to bring up there info, not there ticket history. So i click on there history, guess what another 30 seconds on the clock, so it starting to get bad, after that you can click on individual tickets, create a new one or use tabs to look at more info. Each tab when clicked on takes 5-25 seconds to open. And these are the fast times, other times i sit 30 secs to about 1 min to get anything useful, and there have been times that I started a query when I left for break , came back and still had 5 mins to wait till it finally showed some results. My querries where presise and dont pull alot of data, but this is getting ridicolous. So how does a database get this slow? traffic? Nope cant be traffic, I work 3 rd shift and have about 15 people who use it , during the day over 100 people use it. What about maitnence? not likely, thats run once a week for about 2 hours or so.

What else could it be? corrupted database? bad design for a large database? I  have never worked with a large database like that before so I don’t know the challenges of design or maintenance of such a large beast. But I have worked with smaller DBs that had similar slowdowns, but that was caused by too much data being pulled, like querying the entire DB or a few thousand rows. Or could the bandit be the vendor lock on the ticketing system in combo there DB, by the way the ticketing system looks very customized and even has features, custom built by other vendors, like the data being pulled from  an access database or integration into 2 other ticketing systems. My guess is Oracles Seibel, and DB work wonders out of the box and setup correctly even better when you use there system to input the data. I wonder who approved adding more plugins was a great idea?  This kind of bloat is inexcusable in a place where employees are timed. How do you fix something thats going to get screwed anyways, there policy just keep it chugging along, my solution would be to start gettting rid of or migrating 3yr+ old tickets and closed accounts to another DB, at least it would be a start, next would be to start removing the bloat from system, we do not need it to make our coffee and tell us were great. We need something light fast and simple, all we want to do is get the person what they want and move on. What will it take for these so called decision makers to realize that there all in one application dream doesn’t work in reality. Maybe this will become the next epic IT failure? not likely because its behind closed doors and if it failed i doubt that they would even tell the employees. So far i enjoy working for the smaller company, at least your voice is heard unlike here where your the bottom of the barrel.

Sorry about the long rant but some things at large companies are inexcusable that can throw money at situations. I thought customer service was supposed to be the focus of what we do. When will the people who call the shots going to learn to think logical instead of  using a magic 8 ball and some business lingo to make decisions about technology.

Hacking the Code

4
Filed under PHP, security, software
Tagged as , , , , , ,

Last Post i was talking about how to clean up a hacked web server, hopeful your server is clean now and you can get back to what you do best. But what was the hacker trying to do? What does that long string mean? I will tell you how to decode the string the safe way, and understand how it was constructed.

The Example that I am going to use is from a real hacked website, the code that I will display is only partial but the construct will be complete. Any identifiable URLs will be changed to prevent identification and your safety.
Lets start by identifying the code, this is what i had found at the very beginning of the page.
<? /**/eval(base64_decode(aWYoZnVuY3Rpb25<–>KTt9fX0=)); ?>

lets start with /**/, it looks innocent but its a way to hide the code, what the code usually used for is large blocks of comments instead of using // on each line you would start it with /* and  end with */ but what i noticed is that in bluefish and notepad++ when these are highlighted the whole line appears to be a comment, my guess is that other code scanners will look like one long comment  on that line and skip it. But this is just my conclusion and testing, very clever way to use comments.

almost forgot the first thing to notice is the use of short tags(<?) that they use, on my personal server I have short tags disabled, I had learned that it should be disabled for security purposes, I don’t know if this holds true today. but the reason they use it is it helps hide it as a comment adding php to   it (<?php),makes it show up as php code not a comment, now its starting to unravel………

evalEvaluate a string as PHP code

very simple right, they need something to run there code, eval does this trick, you can even add html to the string. just another peice of the pie.

base64_decode – it decodes base64 code, now what is base64? It was originally for email to send binary data in emails, and other uses like binary data in urls and other variables but newest use is hiding php code in a long string, the string was 2692 characters long. So what did that string have in it.

Read More »