<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Curtisbeef &#187; Projects</title>
	<atom:link href="http://www.curtisbeef.com/category/projects/feed" rel="self" type="application/rss+xml" />
	<link>http://www.curtisbeef.com</link>
	<description>My projects and blog.</description>
	<lastBuildDate>Wed, 09 Jun 2010 05:57:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Super Simple PIC Programmer</title>
		<link>http://www.curtisbeef.com/projects/super-simple-pic-programmer</link>
		<comments>http://www.curtisbeef.com/projects/super-simple-pic-programmer#comments</comments>
		<pubDate>Mon, 08 Feb 2010 10:26:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[PIC ICSP Serial Programmer Simple]]></category>

		<guid isPermaLink="false">http://www.curtisbeef.com/?p=156</guid>
		<description><![CDATA[Here is a Super simple PIC Microcontroller ISCP Programmer that only uses 3 resistors. In this example I use a 18F2550 but it can be used for many other PICs. So, I have a bunch of PIC Microcontrollers laying around that I haven&#8217;t played with in about 2 years, mostly because my old ICSP programmer [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.curtisbeef.com/wp-content/uploads/2010/02/Spp2.png"><img class="size-medium wp-image-157 aligncenter" title="Spp2" src="http://www.curtisbeef.com/wp-content/uploads/2010/02/Spp2-300x271.png" alt="" width="300" height="271" /></a></p>
<p>Here is a <a href="http://www.picbasic.co.uk/forum/showthread.php?t=703">Super simple PIC Microcontroller ISCP Programmer</a> that only uses 3 resistors. In this example I use a <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010280">18F2550</a> but it can be used for many other PICs.</p>
<p><span id="more-156"></span>So, I have a bunch of PIC Microcontrollers laying around that I haven&#8217;t played with in about 2 years, mostly because my old ICSP programmer uses a Parallel port and none of my current computers have one anymore. So I started looking around for a decent low cost programmer and saw that the PicKit2 is favored most by PIC enthusiasts. But when it comes down to it I&#8217;m broke and cant be spending 40 bucks on just a programmer. So I&#8217;m gonna make my own PicKit2 because its pretty simple and the parts can be had for much cheaper than the retail version. But first I have to be able to program a PIC 18F2550 that is used in the PicKit2. So after a few hours on Google I found a super simple serial port programmer that only requires 3 resistors, isn&#8217;t that INSANE!</p>
<p>This schematic is super simple to follow and will work with 18F2550/184550 on computers with REAL serial ports not laptops. You will have to supply the GND(0v) and 5v to the PIC and match up the VPP, Clock and Data lines with your PICs you can find these out on the datasheet for your microcontroller.</p>
<p><a href="http://www.curtisbeef.com/wp-content/uploads/2010/02/circuit_iscp.jpg"><img class="aligncenter size-medium wp-image-160" title="circuit_iscp" src="http://www.curtisbeef.com/wp-content/uploads/2010/02/circuit_iscp-300x200.jpg" alt="" width="300" height="200" /></a></p>
<p>Here is the Original Thread: <a href="http://www.picbasic.co.uk/forum/showthread.php?t=703">http://www.picbasic.co.uk/forum/showthread.php?t=703</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.curtisbeef.com/projects/super-simple-pic-programmer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Arduino Accelerometer Logging Sheild</title>
		<link>http://www.curtisbeef.com/projects/project-arduino-accelerometer-sheild</link>
		<comments>http://www.curtisbeef.com/projects/project-arduino-accelerometer-sheild#comments</comments>
		<pubDate>Sun, 31 May 2009 04:57:22 +0000</pubDate>
		<dc:creator>Curtisbeef</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Accelerometer]]></category>
		<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.curtisbeef.com/?p=89</guid>
		<description><![CDATA[Alright this is my first time posting a full project, so be gentle if i make any mistakes. Also the project is still ongoing but a few people emailed me asking for details and schematics. So I will be making updates and I will note any updates.   Concept: I had received a few MMA7260 [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.curtisbeef.com/wp-content/uploads/2009/05/img_0773.jpg"><img class="size-full wp-image-92 aligncenter" title="Arduino Accelerometer Project" src="http://www.curtisbeef.com/wp-content/uploads/2009/05/img_0773_thumb.jpg" alt="Accelerometer Project" width="471" height="354" /></a></p>
<p><br class="spacer_" /></p>
<p>Alright this is my first time posting a full project, so be gentle if i make any mistakes. Also the project is still ongoing but a few people emailed me asking for details and schematics. So I will be making updates and I will note any updates.</p>
<p><span id="more-89"></span></p>
<p style="text-align: center;"> </p>
<p style="text-align: center;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://www.youtube.com/v/DKvQrMhRjW8&amp;hl=en&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/DKvQrMhRjW8&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/DKvQrMhRjW8&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true" data="http://www.youtube.com/v/DKvQrMhRjW8&amp;hl=en&amp;fs=1"></embed></object>
</p>
<p><span style="text-decoration: underline;"><span style="font-size: large;"><strong>Concept:</strong></span></span> I had received a few <a href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MMA7260QT&amp;nodeId=01126911184209">MMA7260 </a>3-Axis Accelerometers as samples and wanted to do something cool with them. The project started out as a interface just to play with the Accelerometers, but then I realized I had a Micro SD socket that I had got from <a href="http://www.molex.com">Molex</a> and a 512MB Micro SD card that I was not using.</p>
<p><br class="spacer_" /></p>
<p><span style="text-decoration: underline;"><strong><span style="font-size: large;">Hardware:</span></strong></span><span style="font-size: large;"> </span>OK so first I started off with a <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8783">3.3V Arudino Pro from Sparkfun.com</a> . Its important to note that all of the devices I use for this project are 3.3v logic and power <strong>if you are using a 5v Arduino then you must take this into account,</strong> it will affect the way that you interface and power the chip and the SD card and will require a different schematic.</p>
<p><span style="text-decoration: underline;"><strong>Parts Used:</strong></span></p>
<p><strong>4x</strong> 10K Resistors</p>
<p><strong>4x</strong> 4.7K Resistors</p>
<p><strong>4x</strong> 0.1uf Capacitors</p>
<p><strong>1x</strong> MMA7260 3-Axis Accelerometer</p>
<p><strong>1x</strong> MicroSD Socket</p>
<p><strong>1x</strong> Pushbutton Switch</p>
<p><br class="spacer_" /></p>
<p style="text-align: center;"><a href="http://www.curtisbeef.com/wp-content/uploads/2009/05/img_0785.jpg"><img class="size-full wp-image-97 alignnone" title="Top_thumb" src="http://www.curtisbeef.com/wp-content/uploads/2009/05/img_0785_thumb.jpg" alt="Top_thumb" width="216" height="200" /></a><a href="http://www.curtisbeef.com/wp-content/uploads/2009/05/img_0790.jpg"><img class="size-full wp-image-98 alignnone" title="bottom_thumb" src="http://www.curtisbeef.com/wp-content/uploads/2009/05/img_0790_thumb.jpg" alt="bottom_thumb" width="284" height="200" /></a></p>
<p><span style="text-decoration: underline;"><strong><span style="font-size: large;">Schematic:</span></strong></span><span style="font-size: large;"> </span></p>
<p style="text-align: center;"><span style="font-size: large;"><a href="http://www.curtisbeef.com/wp-content/uploads/2009/05/schematic.jpg"><img class="aligncenter size-full wp-image-109" title="schematic_thumb" src="http://www.curtisbeef.com/wp-content/uploads/2009/05/schematic_thumb.jpg" alt="schematic_thumb" width="459" height="249" /></a></span></p>
<p style="text-align: left;"><span style="font-size: large;"><span style="text-decoration: underline;"><strong>Firmware:</strong></span></span> The firmware is not totally finished at the moment and may have a few bugs. First of to compile my code in the Arduino IDE your going to have to download the <a href="http://code.google.com/p/fat16lib/">fat16lib</a> library and put it in your &#8220;\arduino-0015\hardware\libraries&#8221; folder,<a href="http://code.google.com/p/fat16lib/"> </a>it is a really a great library and makes logging to a .txt file very simple. <span style="font-size: large;"> </span></p>
<pre class="brush: plain;">/*
* Accelerometer data logger
* with LCD and MicroSD
* Curtis F.
*
*/
#include &lt;EEPROM.h&gt;
// SD Card includes
#include &quot;Fat16.h&quot;
#include &quot;SdCard.h&quot;
SdCard card;
Fat16 file;
// end
#include &lt;avr/io.h&gt;
#include &lt;avr/wdt.h&gt;
#define Reset_AVR() wdt_enable(WDTO_30MS); while(1) {}

int buttonPin = 5; //button Pin
int GS1Pin = 2; //Gravity Select Pin 1
int GS2Pin = 3; //Gravity Select Pin 2
int AccSleepPin = 4; // Accelorometer sleep pin for enable/disable
int X, Y, Z; // Raw ADC values for XYZ
int sendtoserial = 0;
int samplestaken = 0;
int isLoggingData = 1;
int val = 0;

void setup()
{
    pinMode(buttonPin, INPUT);
    pinMode(GS1Pin, OUTPUT);
    pinMode(GS2Pin, OUTPUT);
    pinMode(AccSleepPin, OUTPUT);
    Serial.begin(19200);
    Serial.println(&quot;Accelerometer data logger&quot;);
    analogReference(EXTERNAL); // ser ADC voltage ref to 3.3 external
    digitalWrite(GS1Pin, LOW); // set inital 1.5G sensitiviy
    digitalWrite(GS2Pin, LOW);
    digitalWrite(AccSleepPin, HIGH); // turn on Accelorometer
    sendtoserial = EEPROM.read(1);
    //SD card Int
        intcardfunction();
    // End
    if (sendtoserial == 0) Serial.println(&quot;MicroSD Log&quot;);
}

void loop()
{
  while (1) {
    X = analogRead(2); // store values
    Y = analogRead(1);
    Z = analogRead(0);

  if (sendtoserial == 1) {
    Serial.print(40, BYTE); // print &quot;(&quot; charcater
    Serial.print(X); // send raw values out serial port
    Serial.print(Y);
    Serial.print(Z);
    Serial.println(41, BYTE); // print &quot;)&quot; charcater
    delay(5);

    val = digitalRead(buttonPin); // read input value
    if (val == HIGH) { // check if the input is HIGH
    while (digitalRead(buttonPin) == HIGH){}
    Serial.println(&quot;Reset_AVR();&quot;);
    EEPROM.write(1, 0);
    Reset_AVR(); //reset to load to default MicroSD logging mode
    }
  }
  if (sendtoserial == 0) {
    logtosdcard();
    val = digitalRead(buttonPin); // read input value
    if (val == HIGH) { // check if the input is HIGH
    EEPROM.write(1, 1);
    while (digitalRead(buttonPin) == HIGH){}
    Serial.println(&quot;Reset_AVR();&quot;);
    Reset_AVR(); //reset to load to default MicroSD logging mode
    }

  }
    serbPollSerialPort(); // listen on serial port for commands
  }
    delay(1);
}

void intcardfunction()
{
  if (!card.init()) error(&quot;card.init&quot;); // initialize
  if (!Fat16::init(card, 1)) {
    // try super floppy
    if (!Fat16::init(card, 0)) error(&quot;Fat16::init&quot;);
  }
}

void logtosdcard()
{
  char name[] = &quot;LOG-00.TXT&quot;;
  for (uint8_t i = 0; i &lt; 254; i++) {
    name[4] = i/10 + '0';
    name[5] = i%10 + '0';
    if (file.create(name)) break;
  }
  if (!file.isOpen()) error (&quot;file.create&quot;);
    file.print(millis());
    file.print(&quot;:&quot;);
    file.print(40, BYTE);// print &quot;(&quot; charcater
    file.print(X, DEC);
    file.print(&quot;,&quot;);
    file.print(Y, DEC);
    file.print(&quot;,&quot;);
    file.print(Z, DEC);
    file.println(41, BYTE);// print &quot;)&quot; charcater
    samplestaken++ ;
  if (samplestaken &gt; 15)
  {
    file.sync();
    samplestaken = 0;
  }
}

void serbPollSerialPort()
{
  int dta; //variable to hold the serial byte
  if ( Serial.available() &gt;= 5) { //if 5 bytes are in the buffer (length pf a full request)
    dta = Serial.read();
    if ( dta = 65){ //Checks for first check byte &quot;A&quot;
      dta = Serial.read();
        if ( dta = 65){ //Checks for second check byte &quot;A&quot;
          dta = Serial.read();
            if ( dta = 65){ //Checks for third check byte &quot;A&quot;
               int command = Serial.read(); //Fourth byte is the command
               int param1 = Serial.read(); //Fifth byte is param1
               interpretCommand(command, param1); //sends the parsed request to it's handler
            }
        }
      }
    }
}

void interpretCommand(int command, int param1)
{
if (command == 83){ // If command = &quot;S&quot; then
  switch (param1) {
    case 49: // case command parameter = &quot;1&quot;
      digitalWrite(AccSleepPin, LOW); // turn off Accelorometer
      delay(100);
      digitalWrite(GS1Pin, LOW); // change to 1.5G sensitivity
      digitalWrite(GS2Pin, LOW);
      delay(400);
      Serial.flush(); // clear buffer
      digitalWrite(AccSleepPin, HIGH); // turn on Accelorometer
      break;
    case 50: // case command parameter = &quot;2&quot;
      digitalWrite(AccSleepPin, LOW);
      delay(100);
      digitalWrite(GS1Pin, LOW);// change to 2G sensitivity
      digitalWrite(GS2Pin, HIGH);
      delay(400);
      Serial.flush(); // clear buffer
      digitalWrite(AccSleepPin, HIGH); // turn on Accelorometer
      break;
    case 51: // case command parameter = &quot;3&quot;
      digitalWrite(AccSleepPin, LOW);
      delay(100);
      digitalWrite(GS1Pin, HIGH);// change to 4G sensitivity
      digitalWrite(GS2Pin, LOW);
      delay(400);
      Serial.flush(); // clear buffer
      digitalWrite(AccSleepPin, HIGH); // turn on Accelorometer
      break;
    case 52: // case command parameter = &quot;4&quot;
      digitalWrite(AccSleepPin, LOW);
      delay(100);
      digitalWrite(GS1Pin, HIGH);// change to 6G sensitivity
      digitalWrite(GS2Pin, HIGH);
      delay(400);
      Serial.flush(); // clear buffer
      digitalWrite(AccSleepPin, HIGH); // turn on Accelorometer
      break;
     }
}
if (command == 69){ // if command = &quot;E&quot; then
  switch (param1) {
    case 69: // case command parameter = &quot;E&quot;
      digitalWrite(AccSleepPin, HIGH);
      Serial.flush();
      break;
    case 68: // case command parameter = &quot;D&quot;
      digitalWrite(AccSleepPin, LOW);
      Serial.flush();
      break;
    }
  }
}

void error(char *str)
{
  sendtoserial = 1;
  Serial.print(&quot;error: &quot;);
  Serial.println(str);
}</pre>
<p style="text-align: left;"><span style="font-size: large;"><br />
 </span></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><span style="font-size: large;"><span style="text-decoration: underline;"><strong>Software:</strong></span><strong> </strong></span>Here is a quick VB6 program I threw together to visualize the data. Im working on making it read log files and play them back but that feature is not done yet. Please beware this program was written fast and without comments its sloppy and hard to read. Its just for debugging. <a href="http://www.curtisbeef.com/upload/Acc.zip">Here</a> is the Source.</p>
<p style="text-align: center;"><a href="http://www.curtisbeef.com/wp-content/uploads/2009/05/accprogram.jpg"><img class="aligncenter size-full wp-image-121" title="accprogram_thumb" src="http://www.curtisbeef.com/wp-content/uploads/2009/05/accprogram_thumb.jpg" alt="accprogram_thumb" width="550" height="330" /></a></p>
<p><br class="spacer_" /></p>
<p><span style="text-decoration: underline;"><strong><span style="font-size: large;">Function:</span></strong></span> The Device has 2 modes logging and streaming. To Enter serial mode to allow for use of the PC program and streaming data you hold the push button for 2 seconds during power on. Otherwise the device will automatically start logging a *.txt file to a MicroSD card with the time(in milliseconds since power on) and XYZ values. The text file can easily be parsed in or some other spreadsheet program and made into line graphs. If no MicroSD card for 30 seconds or so(not my control) it will start to send serial data. You can change the mode while logging or streaming by pressing the button once this will put it into the opposite mode.</p>
<p><a href="http://www.curtisbeef.com/wp-content/uploads/2009/05/lognotepad.jpg"><img class="aligncenter size-full wp-image-74" title="lognotepad" src="http://www.curtisbeef.com/wp-content/uploads/2009/05/lognotepad.jpg" alt="lognotepad" width="345" height="258" /></a></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.curtisbeef.com/projects/project-arduino-accelerometer-sheild/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
