tag:blogger.com,1999:blog-16064699587814273972024-03-13T15:39:55.731-07:00Microcontroller Notebookrinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-1606469958781427397.post-1770009887836204992012-11-08T13:31:00.001-08:002012-11-12T14:13:48.701-08:00Arduino PID Temperature Controller and Sous Vide<b>Project Objective:</b> To design a PID temperature controller using the Arduino and apply it to Sous Vide.<br />
<br />
<b>Introduction: </b>This all started as a project to control beer brewing which is still in the works. In order to get there, there are a series of projects which can be used to break the problem down into workable pieces. Basically, brewing beer requires heating liquids contained in kettles and then moving the liquid from kettle to kettle. So what is needed is a way to heat the liquid to a controlled temperature and then turning pumps on and off. So what do we need:<br />
<ul>
<li>Kettles with heaters, fittings and pumps.</li>
<li>An electronic controller with PID capabilities.</li>
</ul>
A single kettle version of this is what is need for a Sous Vide system including a small pump to keep the temperature of the water, uniform.<br />
<br />
<b>Interesting Links:</b> Before we get started here are some useful links on this subject.<br />
<br />
<ul>
<li><a href="http://lowereastkitchen.com/wp/">Lower East Kitchen: </a> On this site you will find a kit for a PID controller design for Sous Vide. Though the controller can be used for any water bath they suggest using a stainless coffee urn available from Amazon for $25. </li>
</ul>
<br />
<br />
<b>PID Controller:</b> A Arduino based PID temperature controller has been developed by Brett Beauregard and Rocket Scream Electronics called the osPID. This design was predated by the <span style="background-color: white; color: #202020; font-family: 'Trebuchet MS'; font-size: 15px; line-height: 22px;">Reflow Oven Controller Shield available from Rocket Scream</span><br />
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b>Sous Vide Hardware:</b><br />
<b><br /></b>
<b><br /></b>
<b><br /></b>
To Be Continued: 11/8/12rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-10486506184514631722012-09-20T18:32:00.001-07:002012-10-08T21:03:01.452-07:00Arduino as Serial LCD Display<br />
<div style="margin-bottom: .0001pt; margin: 0in;">
<b>Project Objective:</b> In this project we will use the Arduino to emulate the PH
Anderson #117 serial text display minus big numbers. The layout of a piggyback pcb
will complete the project.<o:p></o:p></div>
<div style="margin: 0in 0in 0.0001pt;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<b>Introduction:</b> See
the discussion in the "Controlling a Serial Display" project which
covers several of the serial LCD displays on the market. Most of these products
have a similar command set and the sketch presented here could be modified to
emulate many of these.<o:p></o:p></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
Serial LCD displays are available in both text and graphic
versions. This project covers text displays with one to four lines and up to 40
columns. Initially, the displays will be limited to 80 total characters, a
limitation of the Arduino standard LCD library.<br />
<br />
Since the serial LCD is a one wire device, all control of the LCD terminal must use command sequences. Here are the commands used in this project:<br />
<br />
<br />
<b>Arduino Serial LCD Rev. A: Command Set (as of 9/16/12)</b><br />
<span style="font-family: Times, Times New Roman, serif;"><span style="white-space: pre;"> </span>Command </span><br />
<span style="font-family: Times, Times New Roman, serif;">?a<span style="white-space: pre;"> </span>home cursor</span><br />
<span style="font-family: Times, Times New Roman, serif;">?b<span style="white-space: pre;"> </span>destructive backspace</span><br />
<span style="font-family: Times, Times New Roman, serif;">?c#<span style="white-space: pre;"> </span>set cursor style, 0= none 2= blinking 3=underline</span><br />
<span style="font-family: Times, Times New Roman, serif;">?f<span style="white-space: pre;"> </span>clear screen</span><br />
<span style="font-family: Times, Times New Roman, serif;">?g<span style="white-space: pre;"> </span>Beep </span><br />
<span style="font-family: Times, Times New Roman, serif;">?h<span style="white-space: pre;"> </span>Backup Cursor (Non-destructive backspace)</span><br />
<span style="font-family: Times, Times New Roman, serif;">?i<span style="white-space: pre;"> </span>Forward cursor</span><br />
<span style="font-family: Times, Times New Roman, serif;">?j<span style="white-space: pre;"> </span>Up cursor</span><br />
<span style="font-family: Times, Times New Roman, serif;">?k<span style="white-space: pre;"> </span>Down cursor</span><br />
<span style="font-family: Times, Times New Roman, serif;">?l<span style="white-space: pre;"> </span>Clear cursor line</span><br />
<span style="font-family: Times, Times New Roman, serif;">?m<span style="white-space: pre;"> </span>Carriage Return</span><br />
<span style="font-family: Times, Times New Roman, serif;">?n<span style="white-space: pre;"> </span>CRLF, cursor at start of next line, line cleared</span><br />
<span style="font-family: Times, Times New Roman, serif;">?p###<span style="white-space: pre;"> </span>Position cursor x = ##, y = #</span><br />
<span style="font-family: Times, Times New Roman, serif;">?x##<span style="white-space: pre;"> </span>Position cursor on x column, (two characters are required), first column is column 0, </span><br />
<span style="font-family: Times, Times New Roman, serif;">?y#<span style="white-space: pre;"> </span>Position cursor at y row, first row is row 0 (one character only)</span><br />
<span style="font-family: Times, Times New Roman, serif;">??<span style="white-space: pre;"> </span>display a "?"</span><br />
<span style="font-family: Times, Times New Roman, serif;">?!<span style="white-space: pre;"> </span>Send direct command to LCD</span><br />
<span style="font-family: Times, Times New Roman, serif;">?B<span style="white-space: pre;"> </span>Backlight Intensity ā sets PWM value, two hex digits req. (00 to FF)</span><br />
<span style="font-family: Times, Times New Roman, serif;">?D# Define custom character. See text.</span><br />
<span style="font-family: Times, Times New Roman, serif;">?#<span style="white-space: pre;"> </span>Print a custom character</span><br />
<span style="font-family: Times, Times New Roman, serif;">?H<span style="white-space: pre;"> </span>High output on auxiliary digital pins: valid numbers are 1,2,3,4</span><br />
<span style="font-family: Times, Times New Roman, serif;">?L<span style="white-space: pre;"> </span>Low output on auxiliary digital pins: valid numbers are 1,2,3,4</span><br />
<span style="font-family: Times, Times New Roman, serif;">?G<span style="white-space: pre;"> </span>Configure for LCD geometry. Supported formats: 2X16, 2X20, 2X24, 2X40, 4X16 and 4X20.</span><br />
<br class="Apple-interchange-newline" />
<br />
Except for the ?p### command they are identical to the PH Anderson, #117 chip. The start character for a command sequence is a '?', but this can be easily changed in the sketch, say to a '!'. The sketch below compiles, but some commands are missing.<br />
<br />
One of the nice features of the #117 command set is that control can be accomplished using a PC termial program. In fact, using the Arduino IDE to update the code the built in terminal can be opened to test changes.The piggyback pcb can be modified and updated the same way.<br />
<br />
<i>Note:</i> As of 10/08/12 the code was updated, as well as the schematic.The schematic changes were made to simplify the piggyback pcb layout. Because of this there were also changes to code. Several additional commands have been added and we will continue to add more.<br />
<br /></div>
<div class="sites-canvas-main" id="sites-canvas-main" style="min-height: 150px; padding-bottom: 5px; padding-top: 15px;">
<div id="sites-canvas-main-content">
<table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox" style="margin: 0px; table-layout: fixed; width: 731px;" xmlns="http://www.w3.org/1999/xhtml"><tbody>
<tr><td class="sites-layout-tile sites-tile-name-content-1" style="padding: 10px; vertical-align: top;"><div dir="ltr">
<br />
<div>
<b>Schematic Used with Solderless Breadboard:</b></div>
<div>
<br /></div>
<div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyX8LpTJqO_TrYVqYk-FUzSmJIR3NfRVHwCfyxiIGb7hCUnQx2TR1Jg11oLKjUXip8E8DVCcFWIQzr277DSgLZ6chFRk1QHnfF0gLKWk_paeKM5fqD5We55B_nc41kmLk_7kxbY0LKxvdn/s1600/SerialLCDDisplayRev2C.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyX8LpTJqO_TrYVqYk-FUzSmJIR3NfRVHwCfyxiIGb7hCUnQx2TR1Jg11oLKjUXip8E8DVCcFWIQzr277DSgLZ6chFRk1QHnfF0gLKWk_paeKM5fqD5We55B_nc41kmLk_7kxbY0LKxvdn/s640/SerialLCDDisplayRev2C.png" width="625" /></a></div>
<br />
<br />
<span style="font-family: inherit;">The schematic above shows the parts which need to be added to the
solderless breadboard for this project. The headers in the schematic are the
the headers on the Arduino board. The piggyback board will require a different
schematic and include the atmega328, as well as, serial interface circuits and
jumpers.</span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<u1:p></u1:p></div>
<div style="margin: 0in 0in 0.0001pt;">
<br /></div>
<div style="margin: 0in 0in 0.0001pt;">
<div class="MsoNormal">
<span style="font-family: inherit;"><span style="color: #323229;">The image <span style="font-family: inherit;">below</span> shows the Arduino Serial LCD connected to an
Arduino sending serial data at 9600 baude. The text being sent is
"Temperature" and "76.8" or "77.6", where the
word Temperature is sent once and the numbers sent alternately in the loop </span>section of the sketch. Before
the numbers are sent the cursor is positioned at character column 14. The small
round object is a piezo speaker.</span></div>
</div>
<br />
<u1:p></u1:p></div>
<div>
<br /></div>
<div>
<div style="margin-left: auto; margin-right: auto; text-align: center;">
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://sites.google.com/site/totallyfablab/projects/electronics/arduino-as-serial-display/100_0061C.jpg?attredirects=0" imageanchor="1" style="background-image: none; border-bottom-style: none; clear: left; color: #551a8b; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="167" src="https://sites.google.com/site/totallyfablab/_/rsrc/1347917507655/projects/electronics/arduino-as-serial-display/100_0061C.jpg?height=167&width=400" style="border: 0px; padding: 0px;" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Arduino on left is sending serial data to Arduino on right.<br />
<br />
<br /></td></tr>
</tbody></table>
</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b><b><br /></b><br />
<b><br /></b>
<b><br /></b>
<b>Sketch:</b>Version 0.6</div>
<div>
<br /></div>
<div>
<div>
<br />
/*<br />
Arduino_PHAnderson #117 Serial LCD emulator<br />
Date: 10/08/12<br />
Author: R. LaSalle<br />
<br />
*/<br />
<br />
#include <LiquidCrystal.h><br />
#include <EEPROM.h><br />
<br />
/* LCD pin assignments<br />
RS 8<br />
RW 9<br />
E 10<br />
D4 4<br />
D5 5<br />
D6 6<br />
D7 7<br />
*/<br />
<br />
#define BP 3<br />
#define BL 11<br />
#define Bd0 14<br />
#define Bd1 15<br />
<br />
#define maxrowloc 0<br />
#define maxcolloc 1<br />
#define bootscrloc 2<br />
#define curtypeloc 3<br />
#define ledblloc 4<br />
#define tabloc 5<br />
#define user0 10<br />
#define user1 30<br />
#define user2 50<br />
#define user3 70<br />
<br />
#define commchr '?'<br />
//#define VER .5<br />
<br />
uint16_t bauderate = 9600;<br />
uint8_t maxrow = 4;<br />
uint8_t maxcol = 20;<br />
uint8_t bootscr = 1;<br />
uint8_t ledbl = 0x7f;<br />
uint8_t nrow =0;<br />
uint8_t ncol =0;<br />
int8_t temp =0;<br />
int8_t temp1 =0;<br />
int8_t temp2 =0;<br />
int8_t temp3 =0;<br />
<br />
LiquidCrystal lcd(8,9,10,4,5,6,7);<br />
<br />
void setup() {<br />
// EEPROM.write(maxrowloc,0);<br />
// EEPROM.write(maxcolloc,0);<br />
temp=EEPROM.read(maxrowloc);<br />
temp1=EEPROM.read(maxcolloc);<br />
if(temp==0 && temp1==0){ //Is EEPROM empty? If yes load defaults.<br />
maxrow=4;<br />
maxcol=20;<br />
EEPROM.write(maxrowloc,maxrow);<br />
EEPROM.write(maxcolloc,maxcol);<br />
}<br />
maxrow=EEPROM.read(maxrowloc);<br />
maxcol=EEPROM.read(maxcolloc);<br />
lcd.begin(maxcol,maxrow); // Change this for other screen sizes.<br />
pinMode(Bd0,INPUT); //bauderate set bit 0<br />
pinMode(Bd1,INPUT); //bauderate set bit 1<br />
digitalWrite(Bd0,HIGH); //pullup<br />
digitalWrite(Bd1,HIGH); //pullup<br />
if(digitalRead(Bd0)==LOW && digitalRead(Bd1)==LOW){bauderate=2400;}<br />
if(digitalRead(Bd0)==HIGH && digitalRead(Bd1)==LOW){bauderate=9600;}<br />
if(digitalRead(Bd0)==LOW && digitalRead(Bd1)==HIGH){bauderate=19200;}<br />
if(digitalRead(Bd0)==HIGH && digitalRead(Bd1)==HIGH){bauderate=38400;}<br />
Serial.begin(bauderate); // Default baudrate.<br />
pinMode(BL,OUTPUT);<br />
pinMode(BP,OUTPUT);<br />
<br />
analogWrite(BL, ledbl); // Set maximum brightness.<br />
<br />
// Boot Screens<br />
if(bootscr==1){ //Config screen<br />
ncol=0;<br />
nrow=0;<br />
lcd.setCursor(ncol,nrow); //home cursor<br />
lcd.print("Arduino_PHA117");<br />
lcd.setCursor(0, 1);<br />
lcd.print("G:");lcd.print(maxrow);lcd.print("x");<br />
lcd.print(maxcol/10);lcd.print(maxcol%10);<br />
lcd.print(" B:");lcd.print(bauderate);<br />
lcd.setCursor(0,0); //home cursor<br />
}<br />
}<br />
<br />
void loop() {<br />
byte rxbyte = getc(); // Command<br />
//byte temp; // Parameter<br />
<br />
if (rxbyte == commchr) {<br />
switch (getc()) {<br />
case 'p': // Set cursor position (2 parameters, column, row)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> temp=getn();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> temp1=getn();<br />
temp2=getn();<br />
if(temp=='e'||temp1=='e'){<br />
error();<br />
break;<br />
}<br />
temp=temp*10+temp1;<br />
if(temp>maxcol-1){<br />
error();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> break;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> }<br />
ncol=temp;<br />
if(temp2=='e'){<br />
error();<br />
break;<br />
}<br />
if(temp2>maxrow-1){<br />
error();<br />
break;<br />
}<br />
nrow=temp2; <br />
lcd.setCursor(ncol, nrow);<br />
break;<br />
case 'a': // Cursor home (doesn't clear the screen!)<br />
lcd.home();<br />
ncol=0;<br />
nrow=0;<br />
break;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>case 'b': //Destructive backspace<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> lcd.command(16); //cursor back<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> lcd.write(' '); // write space<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> lcd.command(16); //cursor back<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> ncol=ncol-1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> break;<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
case 'c': // Set Cursor type<br />
switch (getc()){<br />
case '0':<br />
lcd.noCursor();<br />
lcd.noBlink();<br />
break;<br />
case '2':<br />
lcd.cursor();<br />
lcd.noBlink();<br />
break;<br />
case '3':<br />
lcd.cursor();<br />
lcd.blink();<br />
break;<br />
default:<br />
break;<br />
}<br />
break;<br />
case 'f': // Clear screen<br />
lcd.clear();<br />
ncol=0;<br />
nrow=0;<br />
break;<br />
case 'g': //beep<br />
tone(BP,4000,250);<br />
break;<br />
case 'h': // Move cursor back<br />
if(ncol>0){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>lcd.command(16);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ncol=ncol-1;<br />
}<br />
break;<br />
case 'i': // Move cursor forward<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(ncol<maxcol){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> lcd.command(20);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> ncol=ncol+1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
break;<br />
case 'j': //Cursor up<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(nrow>0){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> nrow=nrow-1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> lcd.setCursor(ncol,nrow);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
break;<br />
case 'k': //Cursor down<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(nrow<maxrow){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> nrow=nrow+1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> lcd.setCursor(ncol,nrow);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
break;<br />
case 'l': //clear cursor line<br />
ncol=0;<br />
// maxcol=20;<br />
lcd.setCursor(ncol,nrow);<br />
for(byte i=0;i<=maxcol-1;i++){lcd.write(' ');}<br />
ncol=0;<br />
lcd.setCursor(ncol,nrow);<br />
break;<br />
case 'm': //CR<br />
ncol=0;<br />
lcd.setCursor(ncol,nrow);<br />
break;<br />
case 'n': //CRLF<br />
ncol=0;<br />
if(nrow<maxrow-1){nrow=nrow+1;}<br />
lcd.setCursor(ncol,nrow);<br />
break;<br />
case 'x':<br />
temp=getn();<br />
temp1=getn();<br />
if(temp=='e'||temp1=='e'){<br />
error();<br />
break;<br />
}<br />
temp=temp*10+temp1;<br />
if(temp>maxcol-1){<br />
error();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> break;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> }<br />
ncol=temp;<br />
lcd.setCursor(ncol,nrow);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> break;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>case 'y':<br />
temp=getn();<br />
if(temp=='e'){<br />
error();<br />
break;<br />
}<br />
if(temp>maxrow-1){<br />
error();<br />
break;<br />
}<br />
nrow=temp;<br />
lcd.setCursor(ncol,nrow);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>break;<br />
case 'B':<br />
temp=geth();<br />
temp1=geth();<br />
if(temp==0xff || temp1==0xff){break;}<br />
temp=temp<<4;<br />
ledbl=temp+temp1;<br />
EEPROM.write(ledblloc,ledbl);<br />
analogWrite(BL,ledbl);<br />
break;<br />
case 'G': //enter R,C<br />
temp=getn();<br />
temp1=getn();<br />
temp2=getn();<br />
if(temp=='e' || temp1=='e' || temp2=='e'){error();break;}<br />
maxcol=temp1*10+temp2;<br />
maxrow=temp;<br />
EEPROM.write(maxcolloc,maxcol);<br />
EEPROM.write(maxrowloc,maxrow);<br />
break;<br />
}<br />
}<br />
else{<br />
// Otherwise its a plain char so we print it to the LCD.<br />
lcd.write(rxbyte);<br />
ncol=ncol+1;<br />
}<br />
}<br />
<br />
/*<br />
* Waits for a byte to be available, reads and returns it.<br />
*/<br />
byte getc() { //get character<br />
while (Serial.available() == 0);<br />
return Serial.read();<br />
}<br />
<br />
byte getn() { //get decimal digit<br />
byte temp;<br />
while (Serial.available() ==0);<br />
temp=Serial.read()-48;<br />
if(0>temp>9){<br />
return 'e';<br />
}<br />
else{<br />
return temp;<br />
}<br />
}<br />
<br />
byte geth(){ //get hex digit<br />
byte temp=getc();<br />
if(temp>=0x30 && temp<=0x39){<br />
temp=temp-0x30;<br />
return temp;<br />
}<br />
if(temp>=0x61 && temp<=0x66){<br />
temp=temp-0x57;<br />
return temp;<br />
}<br />
return 0xff;<br />
}<br />
<br />
void error(){<br />
tone(6,4000,250);<br />
return;<br />
}<br />
<div>
<br /></div>
</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
.</div>
<div>
<br /></div>
<div>
To Be Continued</div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div id="sites-canvas-bottom-panel" style="font-size: 12px;">
<div id="COMP_page-subpages" style="background-color: #f0eccd; color: #323229; font-family: 'Lucida Grande', 'Lucida Sans Unicode', sans-serif; line-height: 15px;" xmlns="http://www.w3.org/1999/xhtml">
</div>
<div id="sites-attachments" style="background-color: #f0eccd; color: #323229; font-family: 'Lucida Grande', 'Lucida Sans Unicode', sans-serif; line-height: 15px;" xmlns="http://www.w3.org/1999/xhtml">
<div class="sites-attachments-row" style="height: 40px; position: relative;">
<br class="Apple-interchange-newline" /></div>
</div>
</div>
rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-24759236246942734152012-07-03T11:37:00.002-07:002012-07-04T15:00:21.331-07:00uLab40AVR, the ATmega1284P for Solderless Breadboard<b>Project Objective:</b> The uLab40AVR is designed to be functional similar to the uLab28AVR.<br />
<br />
<b>Introduction:</b> This PCB is designed to be a mate to the Daiduino except that it uses the Sanguino pin designations. This will not cause a problem because of the Arduino IDE pin maping. For example, if you connect a LED/resistor to D13 on the uLab40AVR and the Daiduino, then select the appropriate board in the Arduino IDE, the blink sketch will work.<br />
<br />
<b>Specifications:</b><br />
<br />
<ol style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">
<li style="margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Use of thru hole parts except for regulators</span></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Dual regulators for 5V and 3.3V</span></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Use a breakout boards for serial communication, USB or RS232</span></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Power switch</span></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Use jumpers for selecting power source.</span></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">36 pin header for signals and two separate pin sets for powering the SLBB.</span></li>
</ol>
<br class="Apple-interchange-newline" /><br />
<br />
<br />
Note: The design is not complete. 7/3/12rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-57861366494895802282012-07-03T08:14:00.000-07:002012-07-04T14:30:59.412-07:00uLab28AVR, Arduino for Solderless Breadboard<b>Project Objective:</b> To transpose the Arduino to a solderless breadboard plugin.<br />
<br />
<b>Introduction: </b>This board has all the features of the GMduino, Arduino clone, shown on another post. The digital and analog pin designations are identical to the GMduino and, therefore, the Duemilanove. In addition, the ATmega328P pin designations are also shown.<br />
<br />
<b>Specifications:</b><br />
<ol>
<li style="color: #222222; line-height: 18px; margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Use of thru hole parts except for regulators</span></li>
<li style="color: #222222; line-height: 18px; margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Dual regulators for 5V and 3.3V</span></li>
<li style="margin: 0px 0px 0.25em; padding: 0px;"><span style="color: #222222;"><span style="font-family: inherit; line-height: 18px;">Use a breakout boards for serial communication, USB or RS232</span></span></li>
<li style="color: #222222; line-height: 18px; margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Power switch</span></li>
<li style="color: #222222; line-height: 18px; margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">Use jumpers for selecting power source.</span></li>
<li style="color: #222222; line-height: 18px; margin: 0px 0px 0.25em; padding: 0px;"><span style="font-family: inherit;">25 pin header for signals and two separate pin sets for powering the SLBB.</span></li>
</ol>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8eWhd5Ae9EMTZ6PoumE0DYpaS648rjHGJILby09RQ0JB1X09FgO76oruysvJhhOliIaHn6qkLME-YXNQYZJZZo1q_RwfKZULTdt6G9Gx4ExZLsXGEInY00PQX8coEH3RKJCYBolOKVnYS/s1600/IMG_0346C.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8eWhd5Ae9EMTZ6PoumE0DYpaS648rjHGJILby09RQ0JB1X09FgO76oruysvJhhOliIaHn6qkLME-YXNQYZJZZo1q_RwfKZULTdt6G9Gx4ExZLsXGEInY00PQX8coEH3RKJCYBolOKVnYS/s320/IMG_0346C.jpg" width="320" /></a></div>
<br />rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-40533453926380068382012-07-03T06:59:00.000-07:002013-01-23T08:15:10.744-08:00GMduino, a Buildable Clone<b>Project Objective:</b> Design a Arduino clone that is easy to assemble for clubs and beginners<br />
<br />
<b>Introduction:</b> With the criteria of ease of assembly, the first problem is the FTDI USB chip which even for the experienced assembler is not an easy mounting task, but the availability of small FTDI breakout boards solves the problem. I am using the BUB II by Modern Devices since they leave the connector for you to assemble which I add underneath the board.. Adafruit has the Friend, but it is pre-assembled with the connector on the top.<br />
<br />
The standard 7805 type regulator is real-estate hungry and two will be needed, so surface mount LDO regulators are used. These are three pin devices and mounting is not difficult. Low drop out, LDO, devices are used to limit heat dissipation. In fact, we use a 6V wall power supply which at low current has a 8.5VDC output where a 9V wart is at 12VDC.<br />
<br />
The commercial Arduino uses a circuit for switching between external power, wart, and USB which can take up surface space unless smd parts are used. Further, it would be nice if RS232 serial communiction could also be used which means the clone would need to supply power to that breakout. So we opted for jumpers for both power selection and board voltage. In addition a power switch was added for convenience during development and if not wanted can be jumpered out.<br />
<br />
Finally, a vertical reset switch is placed at the front of the board as well as the LED's. This means that with a shield mounted on the Arduino the reset button is still accessible and the LED's can be seen.<br />
<b><br /></b>
<b>Specifications:</b><br />
<ol>
<li>Use of thru hole parts except for regulators</li>
<li>Dual regulators for 5V and 3.3V</li>
<li>Use a breakout board for serial communiction</li>
<li>Place LED's and reset switch at front of board</li>
<li>Add power switch</li>
<li>Use jumpers for selecting power source.</li>
</ol>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl5Tgl8GmtBJsWGn_8-UoUXCKKOknBQB3_e12bM7MLrP7qHf2Fd8FnlWotmeT2NzSVqB-Yi21nwyQjlHvKv-MQ-eK17T9o-eeYlHtCVh9_WeISHmmlx4lT6wT0TO80M-kw5A6XMYxQ_oiX/s1600/IMG_0340C.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl5Tgl8GmtBJsWGn_8-UoUXCKKOknBQB3_e12bM7MLrP7qHf2Fd8FnlWotmeT2NzSVqB-Yi21nwyQjlHvKv-MQ-eK17T9o-eeYlHtCVh9_WeISHmmlx4lT6wT0TO80M-kw5A6XMYxQ_oiX/s320/IMG_0340C.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">GMduino with BUB II. Note the mounting position of BUB II connector.</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-74726547971298844712012-06-22T15:28:00.002-07:002012-06-26T13:27:03.456-07:00GMduino II, Arduino Clone with RTC and EEPROM<b>Project Objective:</b> To design an Arduino clone with through hole parts for easy assembly. The clone also includes an on board real time calendar clock with battery backup and an EEPROM. The board should operate at 5V and 3.3V including the RTC.<br />
<br />
<b>Specifications:</b><br />
<ol>
<li>Arduino clone with stacking connectors</li>
<li>MCU: ATmega328P with Optiboot</li>
<li>Through hole parts, except for regulators</li>
<li>Serial communication using breakout boards</li>
<li>Dual ldo regulators for 5V and 3.3V</li>
<li>Power :input: 6V to 9V wart or USB jumper selectable</li>
<li>Power switch</li>
<li>Auto reset defeat switch</li>
<li>On board I2C, EEPROM and RTC with battery backup.</li>
<li>Vertical reset and ISP at front</li>
</ol>
<b>Introduction:</b> The project is an outgrowth of the Rainwater Monitoring System , RMS. The original development was done with the uLab28 PIC, then resulting in the Picduino. The RMS is basically a water tank level data logger with LCD display and keyboard.<br />
<br />
<br />
<br />
<br />
<br />
<br />
Note: Layout complete ready for BatchPCB, GMduino.03C<br />
<br />
Under constructionrinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-17349639215820568482012-06-14T18:32:00.000-07:002012-07-04T14:34:40.161-07:00Daiduino, an Arduino form with the ATmega1284P<b>Project Objective:</b><br />
Wouldn't you like to have an Arduino that had 4 times the code capacity, more IO pins and used standard shields, but was only slightly larger? So would I. Further, I would like it to use through hole parts, so that it could be assembled as a kit. By the way, dai is a japanese word that means great or big. So Daiduino is a big Arduino but not a mega Arduino.<br />
<br />
<b>Discussion:</b><br />
I started my Google search, looking at the Sanguino which uses the ATmega644P and has 64k bytes of code space, but soon found the ATmega1284P which has the same pinouts and 128k code space. As a matter of fact the Atmega1284P can be used on the Sanguino pcb. Another interesting item is that there is only 6 cent difference in price. Update: Downloading the Sanguino ZIP file indicated that the ATmega1284P is also included in their design.<br />
<br />
<a href="http://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/">Maniacbug</a> site has the most useful data for this project and, in particular, have integrated the ATmega1284P into the Arduino IDE 1.0 environment. So the next step is to determine board size and pin assignments. Since I have already designed a through hole Arduino clone, transfering the power section to the Daiduino will be the first step. That process created a board 3.4" by 2.1".<br />
<br />
For pin assignments, there are two designs on the Web to look at, Calunium and Bobuino.. Of the two the Calunium can use a standard shield, but is only USB powered. There is limited information on the Bobuino, but Maniacbug includes it in his zip file.<br />
<br />
<b>Specifications:</b><br />
<ol>
<li>Same width as the Arduino but longer, 2.1" by 3.5"</li>
<li>Basic set of stacking connectors, UNO</li>
<li>Dual regulators for 3.3V and 5V</li>
<li>Power source: USB or wart</li>
<li>USB interface on a plug in, such as a BUB II</li>
<li>Through hole parts with the exception of the regulators.</li>
<li>LED's, reset switch and ISP at front of the board</li>
<li>Jumpers A4, A5 to I2C for UNO compatibility</li>
<li>Jumper Auto Reset</li>
</ol>
Note: First version PCB ready for Batchpcb, 06/18/12. Ordered 06/19/12<br />
<br />
Workingrinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com1tag:blogger.com,1999:blog-1606469958781427397.post-58908652367808867532012-05-18T17:29:00.000-07:002012-05-19T20:59:01.403-07:00Bootloaders: How they Work.Micro controller units are devices which contain a processing unit, programming and data memory and I/O. Early MCU's could not modify its program memory only the data memory. The program memory of present day MCU's can be modified with an in circuit programmer - ISP or ICSP - thru designated pins on the device or by the processor using special instructions.<br />
<br />
A bootloader is firmware, usually written into upper memory, which is executed when the MCU is reset. Typically, on reset, the bootloader waits for data to be input on the serial port and if this does not happen in a few seconds the bootloader jumps to the previously loaded code. If the data does start flowing, it is checked for correct protocol and loaded into program memory. The Atmel ATmega and the Microchip 18F MCU's handle bootloaders in a similar way.<br />
<br />
A bootloader PC application interfaces with the MCU using the serial port. Before using the pc app to download the hex code, the reset switch at the MCU must be pressed. This sequence can be simplified by the PC application first triggering the serial port's DTR signal which at the MCU is connected to the reset pin. On the Arduino this is called auto reset.<br />
<br />
<br />rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-58893400501671063882012-05-13T00:44:00.001-07:002012-07-09T15:27:39.126-07:00Programming the Optiboot into the ATmega328I have been using the PicKit2 and a ZIF socket to program the 18F series of MCU. This setup is inexpensive and handy. I would like to have a similar setup for use with the Atmel mcu's.<br />
<br />
<b>USBasp: </b>The least expensive ATmega in circuit programmer, ISP, I have come across is the <a href="http://www.fischl.de/usbasp/">USBasp</a> which is sold on many sites and all seem to be by different unknown manufacturers. The USBasp sold by HobbyKing for $4.50 had good reviews and a cable with both 10 pin and 6 pin connectors. The Arduino boards, as well as my designs, use a 6 pin ISP connector. I also located 28 pin, 0.3" ZIF sockets made by Textool, # 228-3341, which I cannot find in the Textool datasheets since it has been discontinued. I ordered and have received 2 sockets and they indeed have that number. Here are some sources for the USBasp:<br />
<ol>
<li>HobbyKing of HK:<a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=21321"> USBasp programming device for Atmel processors</a></li>
<li>XHeli: <a href="http://www.xheli.com/09h005-07-kk-board-usb-isp.html">KK control board USBasp</a></li>
<li>Fun4diy: <a href="http://www.fun4diy.com/">USBasp kit</a></li>
<li>ProtoStack: <a href="http://www.protostack.com/accessories/usbasp-avr-programmer">USBasp AVR Programmer</a></li>
</ol>
Except for the HobbyKing unit all the USBasp above have 10 pin cables so that a 10 pin to 6 pin adapter will be needed. If you are good at making IDC cables you can make a cable similar to HobbyKing's.<br />
<br />
<b>EMS ISP Shield:</b> <a href="http://evilmadscience.com/productsmenu/tinykitlist/253">Evil Magic Science</a> makes a Arduino shield kit that contains a ZIF socket and can be used with the Arduino ISP sketch to program bootloaders into ATmega MCU's. Adafruit sells a similar kit. The bare pcb from the EMS kit, which is sold separately, could be used as a standalone ZIF board with the USBasp to do the same thing.<br />
<br />
<b>OptiLoader: </b>This sketch, which can be found <a href="https://github.com/WestfW/OptiLoader">here</a>, turns a Arduino board into a stand alone optiboot programmer. The sketch contains images of OptiBoot hex files for several ATmega devices. When the reset switch is pressed, OptiLoader looks at the attached ATmega device to determine what it is and then programs it with the correct OptiBoot. While doing this, sequence data is sent out the serial port which can be monitored with the Arduino IDE serial communication tool.<br />
<br />
For a setup using solderless breadboards look <a href="http://www.3guys1laser.com/blog-burn-bootloader-blank-atmega328atmega328p-arduino-uno#comment-59">here</a>. My setup will use a modified Evil Mad Science ISP shield, purchased as a bare pcb, and an Arduino Duemilanove<br />
<br />
<b>AdaLoader: </b>This sketch, which can be found here, is based on the OptiLoader, but uses LED's and a beeper as progress feed back. The AdaLoader sketch has only one bootloader image and the LadyAda site describes how to change the image. The AdaLoader uses LED's for PROG and ERROR connected to pins A0 and D8, respectively, and a beeper to indicate program completion at pin A3. To program the bootloader press reset after loading the ATmega into the ZIF socket assuming your using the ISP shield.<br />
<br />
<b>ArduinoISP:</b> This sketch which is part of the Arduino IDE download and can be found in the Examples folder turns an Arduino board into and AVRISP programmer. The ArduinoISP uses LED's for PROG, ERROR and HEARTBEAT connected to pins D7, D8 and D9, respectively.<br />
<br />
<b>ArduinoISP2:</b> This sketch which is available at <a href="http://www.ladyada.net/library/arduino/arduinoisp.html">LaydAda</a> is based on the ArduinoISP sketch, but has been modified to work with Arduino IDE 1.0. The ArduinoISP2 uses LED's for PROG and ERROR using A0 and D8. A beeper connected to A3 signals program complete. To program the ATmega328P device, first, dowmload the ArduinoISP2 sketch to the Arduino, then using the IDE do Tools > Burn Bootloader > w/Arduino as ISP. The green LED will light indicating the bootloader is being loaded. When loading is complete the green light will go out and the IDE will show "Done burning bootloader".<br />
<br />
<b>EMS ISP Shield Modifications:</b><br />
Changes<br />
<ol>
<li>Cut land from reset switch and connect switch to Arduino Reset pin.</li>
<li>Cut land from anode of Hello LED and connect to A0 pin.</li>
<li>Add beeper and connect to pin A3.</li>
</ol>
<br />
<br />
<b>New ISP Loader Shield</b><br />
<div>
<i>Project Objective: </i>To design a shield which can be used with all of the above sketches.<br />
<i><br /></i><br />
<i>Specification List:</i><br />
<ol>
<li>28 pin ZIF socket</li>
<li>Reset switch paralleling Arduino board reset switch</li>
<li>Power switch for socket</li>
<li>Both 6 and 10 pin ISP connectors with target power jumper</li>
<li>LED's for PROG, ERROR and HEARTBEAT</li>
<li>Beeper</li>
<li>Serial LCD connector</li>
</ol>
The PCB for the new ISP shield has been received and assembled. The shield was plugged into a Duemilanove, the Arduino IDE 1.0 loaded, the Arduino ISP compiled and downloaded. Using the Tool menu, Burn Bootloader was selected and got a AVRdude sync error. I shifted to IDE 0023 with same results. From reading the web, this is a Auto reset problem. At this point I substituted my home grown Arduino clone, GMduino, described elsewhere in this blog. The only real difference between my clone and the commercial boards is the use of a .1uf capacitor for the auto reset circuit and a switch to disable auto reset.. The commercial boards use a resistor. Using the IDE 0023 I programmed ATmega328P device right off. Not only that, disabling auto reset was not necessary. Is it the capacitor? More testing.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTqpuQemiqN6IejE2ump4Hu3x7ndhYzXngjUTkRmHkd1orgefX0kCvu2kyn_j6O61-H9d48vPdjgeO266WWLTWHXKhA8BURUZ2qN7vFCBve5wKustvxzphbJFkW1ZwnRsqqmJK1jTKq_k/s1600/IMG_0344C.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTqpuQemiqN6IejE2ump4Hu3x7ndhYzXngjUTkRmHkd1orgefX0kCvu2kyn_j6O61-H9d48vPdjgeO266WWLTWHXKhA8BURUZ2qN7vFCBve5wKustvxzphbJFkW1ZwnRsqqmJK1jTKq_k/s320/IMG_0344C.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ISPL Shield Rev A</td></tr>
</tbody></table>
Schmatic:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0ETONQ2538UaPweqzhmQX6djltVhpLKei1tonHaChARwyf4EiT9isd3DO77y13OQq5avxfrqBEI2S8HJCagCRMmZ07OndB7ljj6XgF4YZDSK9y5lMitOJYFZaiJ5W2UYCXEQPM_1vZHWZ/s1600/ISPLoaderShield+RevB_C.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0ETONQ2538UaPweqzhmQX6djltVhpLKei1tonHaChARwyf4EiT9isd3DO77y13OQq5avxfrqBEI2S8HJCagCRMmZ07OndB7ljj6XgF4YZDSK9y5lMitOJYFZaiJ5W2UYCXEQPM_1vZHWZ/s320/ISPLoaderShield+RevB_C.png" width="286" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ISP Loader Shield Rev B</td></tr>
</tbody></table>
<br />
<b>Problems with AutoReset:</b> Normally, before a sketch is downloaded to the Arduino the serial port DTR signal triggers which cause a reset and the bootloader to execute. AVRdude when it connects to the Arduino board also triggers DTR on the serial port causing an Auto Reset.<br />
<br />
<br /></div>
<div>
Still working on this. 6/6/12<br />
<ol>
</ol>
<br />
<br />
<br /></div>rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-46575829705899870722012-05-06T22:59:00.000-07:002012-05-28T11:39:31.750-07:00USB FTDI Breakout ProblemsSince many of my projects use a USB FTDI breakout with a 6 pin output connector, I have been examining the available breakout boards. At the same time I have been examining the Optiboot loader for the Arduino which has added additional questions about these breakouts. To date, the only breakout I have purchased is the Basic USB FTDI breakout DEV 09716 from Sparkfun.<br />
<br />
First, a study of the FTDI chip shows a pin, VCCIO, which control the interface signal levels for the chip. This pin should be tied to 5V, if driving a 5V devices such as the PIC 18F2520 and the ATmega328, or to 3.3V for 3.3Vdevices. If left unconnected, it defaults to 3.3V. On the Sparkfun it is left floating and a work-around is not easy; therefore, the DEV09716 produces 3.3V signals when driving a 5V ATmega or PIC device. Modern Device has found that with the Optiboot this can lead to download problems.<br />
<br />
Though I do not intend to power my development boards from the USB, for those who do, you should noted that the USB can source a maximum of 500ma at 5V, and a maximum of 50ma at 3.3V from the internal LDO regulator on the FTDI chip. Considering the way I will use these breakouts, it would be more useful to tie the power pin of the breakout to VCCIO. Doing this would make sure the interface voltage of the FTDI chip matches the MCU being used; however, in this configuration the breakout could not power the PCB. From the schematic, the Amicus processor card uses this method, that is VCCIO of the FTDI chip tied to the VCC of the 18F25K20. Since the FTDI chip is on the Amicus PCB, the USB can power the board and, since they have an onboard 3.3V regulator, they do not have the current limit problems.<br />
<br />
A final requirement for the USB breakout for use with my boards is that the output connector be mounted on the bottom of the breakout as with the Sparkfun DEV 09716.<br />
<br />
Here are my recommendations for USB breakouts:<br />
<ol>
<li>Modern Device, BUB 1 @ $14.. This unit makes it possible to connect up just about any way you want. Because of this it is bigger than the competition. This unit has a poly fuse and a ferite filter.</li>
<li>Modern Device, BUB 2 @ $14. Similar to Friend with addition of an on board 3.3V optional regulator. The output connector is right angle and is shipped unsoldered. Fused.</li>
<li>Adafruit, USB Friend @ $14.75. For my uses this has all the jumpers, as solder bridges, that I need. No fuses or filters.</li>
<li>DFRobot, DFR0065 @ $15.95 from Jameco. This seems to be alright but I have asked some question of DFRobot so we will see what their answers are. Poly fuse.</li>
</ol>
<ol>
</ol>
Whatever unit I purchase it will be tested in several projects and will be reported here.rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-51831794887643045022012-04-30T11:06:00.002-07:002012-04-30T15:09:58.475-07:00uLab 28 PIC<br />
<div style="margin-bottom: 0in;">
<b>PROJECT OBJECTIVE:</b>
A PIC 28 pin processor board for use with slbb's. The board plugs
into the slbb and incorporates an adjustable regulator for 5Vand
3.3V, a serial communication connector, ICSP, Picaxe and BasicAtom
interfaces.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>INTRODUCTION:</b>
This device was developed to expedite the setup of projects on a
solderless breadboards for 28 pin PIC processors including Picaxe and
BasicAtom.
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>Power:</b>
A single adjustable LDO regulator provides 5V and 3.3V jumper
selectable, switchable power. The switch in its off position shorts
the circuitry to ground for a clean shutdown. A green LED indicates
power on.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>Programming:</b>
The processor can be programmed in-circuit using the Tiny bootloader
with the communication port or ICSP . When using the ICSP, the
programmer, such as the PicKit2, should not be used to power the
processor because of the shorting switch. If a Picaxe or BasicAtom
part is being used, then programming is by the appropriate comm
connector.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>Communication:</b>
The communication interface is not provided on-board, but requires
and appropriate breakout device for RS232 or USB to TTL conversion. A
RS232 SMD breakout board is included as one of our projects, with pcb
and kit available for those using PC com ports. The FTDI USB to TTL
cable available from Mouser will work with Tiny bootloader which
requires RTS on pin 6 for auto-bootloading. (We believe that Amicus
requires DTR on pin 6.)</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>Testing:</b>
A single red LED is provided for quick setup testing. A single
momentary switch is also provided.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>FEATURES:</b></div>
<ul>
<li><div style="margin-bottom: 0in;">
Header for plugging the I/O ports
to a slbb</div>
</li>
<li><div style="margin-bottom: 0in;">
Each port pin marked to ease
jumper connection</div>
</li>
<li><div style="margin-bottom: 0in;">
Mating pins to the slbb power
busses</div>
</li>
<li><div style="margin-bottom: 0in;">
3.3V and 5V selectable power with
switch</div>
</li>
<li><div style="margin-bottom: 0in;">
Picaxe 28X and BasicAtom Nano
programming ports</div>
</li>
<li><div style="margin-bottom: 0in;">
28 pin PIC processors: 16F886,
18F2420, 18F25K20, 18F25K22, etc with Tiny bootloader</div>
</li>
<li><div style="margin-bottom: 0in;">
Power LED</div>
</li>
<li><div style="margin-bottom: 0in;">
Single LED tied to B0 and switch
to B1 for testing</div>
</li>
<li><div style="margin-bottom: 0in;">
Connector bank for easy connection
of sensors to ADC's</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>DIMENSIONS:</b></div>
<div style="margin-bottom: 0in;">
2 inch by 3 inches</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>SCHEMATIC DIAGRAM:</b></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHyWGP_CHD5Ij0_e7-QP0cQe2yUnMklf1_h7oHtImyl8wbFCvKfDJoamw0hGnRbNdRWkdFwz4bPTrO2yOh_RgpkZv4WHmhvmpKoHAQN8pcBmwfOF46zRKZhBp8SM8exb0GakTRbyBa_JlU/s1600/ulab28pic01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHyWGP_CHD5Ij0_e7-QP0cQe2yUnMklf1_h7oHtImyl8wbFCvKfDJoamw0hGnRbNdRWkdFwz4bPTrO2yOh_RgpkZv4WHmhvmpKoHAQN8pcBmwfOF46zRKZhBp8SM8exb0GakTRbyBa_JlU/s320/ulab28pic01.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>PICTURE:</b></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>BOM:</b><br />
<br />
<table border="0" cellspacing="0" cols="5" frame="VOID" rules="NONE">
<colgroup><col width="83"></col><col width="134"></col><col width="148"></col><col width="139"></col><col width="139"></col></colgroup>
<tbody>
<tr>
<td align="LEFT" height="18" width="83">Count</td>
<td align="LEFT" width="134">Label-Value</td>
<td align="LEFT" width="148">Designation(s)</td>
<td align="LEFT" width="139">Mouser PN</td>
<td align="LEFT" width="139">Manf</td>
</tr>
<tr>
<td align="LEFT" height="17"><br /></td>
<td align="LEFT"><br /></td>
<td align="LEFT"><br /></td>
<td align="LEFT"><br /></td>
<td align="LEFT"><br /></td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">470uf 25V</td>
<td align="LEFT">C1 </td>
<td align="LEFT">UHE1E471MPD</td>
<td align="LEFT">Nichicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">22uf@16V</td>
<td align="LEFT">C2 </td>
<td align="LEFT">UVR1C220MDD</td>
<td align="LEFT">Nichicon</td>
</tr>
<tr>
<td align="LEFT" height="17">2</td>
<td align="LEFT"><br /></td>
<td align="LEFT">C10 C9 </td>
<td align="LEFT"><br /></td>
<td align="LEFT"><br /></td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">.1uf</td>
<td align="LEFT">C3 C4 C5 C8 C11 C12</td>
<td align="LEFT">C322C104K5RSTA</td>
<td align="LEFT">Kemet</td>
</tr>
<tr>
<td align="LEFT" height="18">2</td>
<td align="LEFT">22pf</td>
<td align="LEFT">C6 C7 </td>
<td align="LEFT">140-50N2-220J-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">1N5817</td>
<td align="LEFT">D1 </td>
<td align="LEFT">1N5817</td>
<td align="LEFT">Fairchild</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">LED T1 GRN</td>
<td align="LEFT">D2 </td>
<td align="LEFT">HLMP1790</td>
<td align="LEFT">Everlight</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">BAT85</td>
<td align="LEFT">D3 </td>
<td align="LEFT">BAT85</td>
<td align="LEFT">Vishay</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">LED T1 RED</td>
<td align="LEFT">D4 </td>
<td align="LEFT">HLMP1700</td>
<td align="LEFT">Everlight</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">1N4148</td>
<td align="LEFT">D5 </td>
<td align="LEFT">1N4148</td>
<td align="LEFT">Fairchild</td>
</tr>
<tr>
<td align="LEFT" height="17">4</td>
<td align="LEFT">HEADS6</td>
<td align="LEFT">J1 J2 J3 J8 </td>
<td align="LEFT"><br /></td>
<td align="LEFT">3M</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">HEADS24</td>
<td align="LEFT">J4 </td>
<td align="LEFT"><br /></td>
<td align="LEFT">3M</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">HEADRAS6</td>
<td align="LEFT">J5 J6</td>
<td align="LEFT"><br /></td>
<td align="LEFT">3M</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">620454-3</td>
<td align="LEFT">J7 </td>
<td align="LEFT">640456-3</td>
<td align="LEFT">AMP</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">FHEADS2</td>
<td align="LEFT">JC1 </td>
<td align="LEFT"><br /></td>
<td align="LEFT">3M</td>
</tr>
<tr>
<td align="LEFT" height="17">5</td>
<td align="LEFT">HEADS2</td>
<td align="LEFT">JP1 JP2 JP4 JP5 JP6 </td>
<td align="LEFT"><br /></td>
<td align="LEFT">3M</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">HEADS3</td>
<td align="LEFT">JP3 </td>
<td align="LEFT"><br /></td>
<td align="LEFT">3M</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">PJ102A</td>
<td align="LEFT">P1 </td>
<td align="LEFT">CP-102A-ND</td>
<td align="LEFT">Cui (Digikey)</td>
</tr>
<tr>
<td align="LEFT" height="18">5</td>
<td align="LEFT">10K</td>
<td align="LEFT">R1 R10 R2 R6 R9 </td>
<td align="LEFT">270-10K-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">360R 1%</td>
<td align="LEFT">R11 </td>
<td align="LEFT">299-360-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">432R 1%</td>
<td align="LEFT">R12 </td>
<td align="LEFT">299-432-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">120R 1%</td>
<td align="LEFT">R13 </td>
<td align="LEFT">299-120-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">22k</td>
<td align="LEFT">R3 </td>
<td align="LEFT">270-22K-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">2</td>
<td align="LEFT">1K5</td>
<td align="LEFT">R4 R8 </td>
<td align="LEFT">270-1.5K-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">470R</td>
<td align="LEFT">R5 </td>
<td align="LEFT">270-470-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">180R</td>
<td align="LEFT">R7 </td>
<td align="LEFT">270-180-RC</td>
<td align="LEFT">Xicon</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">Switch Slide</td>
<td align="LEFT">S1 </td>
<td align="LEFT">103-12100-EV</td>
<td align="LEFT">Mountain Switch</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">SW 3.5x6mm RED</td>
<td align="LEFT">S2 </td>
<td align="LEFT">TS4311T2601-EV</td>
<td align="LEFT">Mountain Switch</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">SW 3.5x6mm BLK</td>
<td align="LEFT">S3 </td>
<td align="LEFT">TS4311T1601-EV</td>
<td align="LEFT">Mountain Switch</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">Pic 18F</td>
<td align="LEFT">U1 </td>
<td align="LEFT">18F25K22I/SP</td>
<td align="LEFT">Microchip</td>
</tr>
<tr>
<td align="LEFT" height="17">1</td>
<td align="LEFT">Reg. LDO Adj</td>
<td align="LEFT">U2 </td>
<td align="LEFT">NCP1117DTA</td>
<td align="LEFT">ON Semi</td>
</tr>
<tr>
<td align="LEFT" height="18">1</td>
<td align="LEFT">XTAL 16mhz</td>
<td align="LEFT">Y1 </td>
<td align="LEFT">16 mhz</td>
<td align="LEFT"><br /></td>
</tr>
<tr>
<td align="LEFT" height="17" sdnum="1033;" sdval="1">1</td>
<td align="LEFT">Dip Socket 28 pin</td>
<td align="LEFT">SK1</td>
<td align="LEFT">4828-3004-CP</td>
<td align="LEFT">3M</td>
</tr>
</tbody>
</table>
<br />
<b><br /></b></div>
<div style="margin-bottom: 0in;">
PCB LAYOUT: (if required)</div>rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-6877225335177124222012-04-25T12:55:00.000-07:002012-05-03T08:36:14.692-07:00Picduino, Pic on the Arduino Form Factor<br />
<div style="margin-bottom: 0in;">
<b>PROJECT OBJECTIVE:</b>
Replace the AVR processor on the Arduino form factor with a 28 pin
18F PIC processor. Add both an EEPROM and RTC to the design. Use thru
hole, including DIP parts, to facilitate assemble.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>FEATURES:</b></div>
<ul>
<li><div style="margin-bottom: 0in;">
18F, 28 pin
PIC processor (16F optional)</div>
</li>
<li><div style="margin-bottom: 0in;">
Tiny
bootloader with auto-bootloading (DS30 coming)</div>
</li>
<li><div style="margin-bottom: 0in;">
Arduino pcb
form factor</div>
</li>
<li><div style="margin-bottom: 0in;">
Serial
communication using breakout boards</div>
</li>
<li><div style="margin-bottom: 0in;">
Stackable
connectors with Arduino compatible pinout</div>
</li>
<li><div style="margin-bottom: 0in;">
Dual LDO
regulators for 3.3V and 5V.</div>
</li>
<li><div style="margin-bottom: 0in;">
Power switch,
300ma</div>
</li>
<li><div style="margin-bottom: 0in;">
Jumper for
comm port power</div>
</li>
<li><div style="margin-bottom: 0in;">
Onboard I2C
RTC and EEPROM</div>
</li>
<li><div style="margin-bottom: 0in;">
ICSP
connector at front</div>
</li>
<li><div style="margin-bottom: 0in;">
Reset switch
accessible at front</div>
</li>
<li><div style="margin-bottom: 0in;">
Testing LED
on B0 at front</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>INTRODUCTION:</b>
Initially, the18F2520 will be used since there is an available Tiny
bootloader that we have been using with good results. Presently, we are testing the 18F25K22 with the DS30 bootloader.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
This design uses
the Arduino physical stacking connectors, without change, except for
some signal assignments. The USB circuit which is incorporated on the
Arduino has not been incorporated on the Picduino, but will be
contained on a breakout board allowing both RS232 and USB serial
communication. The RS232 breakout will be available with the initial
project and for USB communication the Sparkfun DEV 09716 will be used. This will provide the same USB functionality as the Arduino
with the exception of powering the Picduino from the USB port.<br />
<br /></div>
<div style="margin-bottom: 0in;">
The 18F2520,
18F25K22 and 18F25K20 use 5V and 3.3V respectively; therefore, dual
LDO regulators have been provided. Dual regulators, also seem
reasonable, since there may be shields requiring both voltages. A
switch is used to apply power to the board.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
Since the intended
use for the Picduino is as a base unit for the Rainwater Level
Monitor project, an RTC and EEPROM were incorporated on the main Picduino PCB. Because the
Picduino can operate at 3.3V the RTC, DS1307 can't be used and has
been replaced by the PCF8563 in the design</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
For software
development, several compilers can be used including: OS Basic,
MikroBasic Pro, Swordfish and Proton. If you use the 18F25K20 or 18F25K22, then
the free Amicus compiler can be used. With the latest updates, PicKit2 will program the
18F25K22, see Tips and Tricks. The18F25K22 is also supported by
MPLAB.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
The āCā
compiler used by Arduino can create compiled modules and then linked
from libraries using an Include directive. Both MBP and SF can do
this, but PicBasic Pro, Proton Basic, OS Basic and Amicus can't.
This feature of the AVR-GCC compiler is one of the reasons that the
AVR processor was picked for Arduino and why the Arduino platform is
so successful. Our intention is to develop code with Swordfish and OS Basic. </div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
As an aside, the
method of Arduino development is similar to our method described in
this site. Compile the code, download it, examine its behavior, then
make adjustments to the code and try again. There are code developers
out there who use the AVR-GCC to create modules that the uninitiated
can use. Most of the hard work is done by those developers. For
example, writing code to generate the model train DCC signal is not
simple because of the timings involved, but I am sure some developer
is out there building a DCC module.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
Note 1: The
Arduino uses DTR of RS232 to reset the processor for an autoboot. The
FTDI cable brings out RTS on pin 6 not DTR so it will not work in
autoboot mode. Sparkfun sells a USB breakout board that will work
(DEV-09716).</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
DIMENSIONS:</div>
<div style="margin-bottom: 0in;">
W: 2.7 in, L: 1.9
in, H: .5 in</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
SCHEMATIC DIAGRAM:</div>
<div style="margin-bottom: 0in;">
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpSQLNQ6wz24mkhK3p0KJSGrvLo2Lrg0mD13Y_jmUbiYQgmhj7bRrTLt-OjwzzgpBmE6xKSJ7aqbDL3VA62zm5pJzFmeJ2n31O6iR1OC-FeSestIvDZ3L7vjKw-ct1aULQgg-qN_2QsuOG/s1600/Picduino01Az.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="270" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpSQLNQ6wz24mkhK3p0KJSGrvLo2Lrg0mD13Y_jmUbiYQgmhj7bRrTLt-OjwzzgpBmE6xKSJ7aqbDL3VA62zm5pJzFmeJ2n31O6iR1OC-FeSestIvDZ3L7vjKw-ct1aULQgg-qN_2QsuOG/s320/Picduino01Az.bmp" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhatARyFfMDhDCSEOk_8SSes51fTCHfwCu7ENX5pzswDnlV103CL0-d0877jvg0icEo37137ZEPWUJNFJjIkJlP_Xfo7Ob8gKwuanqDekYVd35KARF2DWF1Ftz_l3bvm5XHXwWImbPOUuq_/s1600/PDRS232_02.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhatARyFfMDhDCSEOk_8SSes51fTCHfwCu7ENX5pzswDnlV103CL0-d0877jvg0icEo37137ZEPWUJNFJjIkJlP_Xfo7Ob8gKwuanqDekYVd35KARF2DWF1Ftz_l3bvm5XHXwWImbPOUuq_/s320/PDRS232_02.bmp" width="320" /></a></div>
<br /></div>
<div style="margin-bottom: 0in;">
<br />
PICTURE:</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2Y9uRocXhUcG6Bf2vmTg9Z0qhwu7g19FVWUJ04GBHnkyX0z9TA9dn3XsZbVtF2xQ2ZFhx2tXwd0JvRtXDDyQXwPKoMBi9sebMmpoNuqNeFaTXQP6-6vNrCLr6Oh-irzxBebNdZfzEkJd5/s1600/IMG_0300C.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2Y9uRocXhUcG6Bf2vmTg9Z0qhwu7g19FVWUJ04GBHnkyX0z9TA9dn3XsZbVtF2xQ2ZFhx2tXwd0JvRtXDDyQXwPKoMBi9sebMmpoNuqNeFaTXQP6-6vNrCLr6Oh-irzxBebNdZfzEkJd5/s320/IMG_0300C.jpg" width="230" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Picduino without serial breakout</td></tr>
</tbody></table>
<br />
<br />
<br />
<br /></div>
<div style="margin-bottom: 0in;">
BILL of MATERIALS:</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
PCB LAYOUT:</div>rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com5tag:blogger.com,1999:blog-1606469958781427397.post-81116027056029085502012-04-23T10:37:00.001-07:002012-04-23T11:48:26.599-07:00Using a LCD Terminal for MCU Software DebuggingOne of the advantages of an in circuit debugger, ICD, is the ability to monitor variables. If you are using a bootloader for development an LCD terminal can be used for that purpose. Connect the LCD terminal to an unused pin on the MCU and output the variable information using software UART code that most compilers provide. Setting a break or tight loop right after the variable output is often necessary. In time I will provide some examples of this method below.rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-22173777846463875092012-04-22T21:30:00.001-07:002013-12-22T17:24:01.211-08:00LCD Terminal, the GMterm II<br />
<div style="margin-bottom: 0in;">
<span style="font-size: medium;"><b>Project GMterm II</b></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>PROJECT OBJECTIVE:</b>
To develop a serial LCD terminal written in OS Basic that will
respond to the PH Anderson command set. To design a pcb for the project.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>INTRODUCTION:</b>
This project started out as an attempt to produce firmware for the 16F886 that would
respond to the command set of the PH Anderson serial LCD products
sold as programmed 16F628 chips, except with all code written in
Basic.. Andersons code was written in assembly language, used an
interrupt driven buffer on the serial input and provided RS232 and
TTL inputs. As mentioned elsewhere in this site, I used PHA's device
to monitor variables during code development and .now I use the GMterm 2.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
GMterm has all
code written in OS Basic and responds to all of the PHA's commands, except for big numbers. It uses a interrupt driven barrel buffer for the input serial data stream. A pcb has also been designed to house
the GMterm chip and, though, the initial design used the 16F886, the
pcb can also use the 18F2420, 18F2520 and the 18F25K22. Since the
code is written in Basic, conversion to the other MCU's is easy.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
Since the 28 pin
devices have additional I/O, other capabilities could be added to the
PHA design, such as, four selectable baude rates, command
controllable contrast and serial interface daughter boards.</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>FEATURES:</b></div>
<ul>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">LCD:
1x8 to 4x40</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">Backlight
control, PWM</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">Contrast
control: digital or analog potentiometer.</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">I/O,
direct TTL and RS232</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">Daughter
board for RS232, RS485 ( full and half duplex) and USB</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">I2C
with branch, 16 address, 6 meters max.( not implemented)</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">USART
select: 8 or 9 bit</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">baude:
2400, 9600, 19.2k, 38.4k</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">GPIO</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">Command
Set: Basic and extended</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">Tiny
Bootloader</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: 'Times New Roman', serif;">MCU:
16F886, 18F2420, 18F2520 and 18F25K22</span></div>
</li>
<li><div style="margin-bottom: 0in;">
Requires external regulated power.</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>DIMENSIONS:</b></div>
<div style="margin-bottom: 0in; margin-left: 0.29in;">
W 1.5 inch, L 2.8
inch</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>PICTURE:</b><br />
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b>SCHEMATIC:</b></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKFGDdOG4HLJiYyd0nPDDgLLevwabi3gyvzlVDkRhqRbQc5lHpOS7KoaMWsy4zNrF14wnHze2Eb0rV7bUdwg8mEj4Y0Z8nZsyAD6lo9NsrTN8-OCRWdj9ttd-5tdKzwfG-gogLXHpAkXjk/s1600/SLCD03D4C.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKFGDdOG4HLJiYyd0nPDDgLLevwabi3gyvzlVDkRhqRbQc5lHpOS7KoaMWsy4zNrF14wnHze2Eb0rV7bUdwg8mEj4Y0Z8nZsyAD6lo9NsrTN8-OCRWdj9ttd-5tdKzwfG-gogLXHpAkXjk/s320/SLCD03D4C.bmp" width="320" /></a></div>
<br />
<br />
<br /></div>
<div style="margin-bottom: 0in;">
<b>SLBB DEVELOPMENT SETUP:</b></div>
<div style="margin-bottom: 0in; margin-left: 0.29in;">
<b>Intro:</b> Th<span style="font-family: inherit;">e solderless breadboa</span>rd, slbb, setup uses the <a href="http://mcunotebook.blogspot.com/2012/04/ulab-28-pic.html">uLab28 PIC</a><b> </b>and is pictured below. This setup implements part of the circuit
diagram: 16F886, LCD, contrast pot and a speaker. If you do not have a uLab28 then the entire circuit can be wired on the slbb. You will also need to provide +5V to the circuit from a separate power supply or a regulator wired on the slbb.</div>
<div style="margin-bottom: 0in; margin-left: 0.29in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.29in;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAjOkDXr_xkrqFpVRun0rU-4yUl31ZWX9ieyOdYPH0IA1FyW1r-FNWSB4synYMMeeauiuAwsxZ4HrqtLjOmvc9JFAq3n31CmwUO8sDBlhlirsTd7gixbXpAmA82t_m5DoPv41Pb5NsLgDa/s1600/IMG_0316C.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="263" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAjOkDXr_xkrqFpVRun0rU-4yUl31ZWX9ieyOdYPH0IA1FyW1r-FNWSB4synYMMeeauiuAwsxZ4HrqtLjOmvc9JFAq3n31CmwUO8sDBlhlirsTd7gixbXpAmA82t_m5DoPv41Pb5NsLgDa/s320/IMG_0316C.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Development setup for LCD terminal using uLab28.</td></tr>
</tbody></table>
<br />
<div style="margin-bottom: 0in;">
<br class="Apple-interchange-newline" /></div>
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in; margin-left: 0.29in;">
<b><span style="font-family: inherit;">What's Needed</span></b></div>
<ol>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> SLBB
with 830 or 1660 contacts</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> Wart:
6 VDC @ 500ma unregulated</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> Addon:
PWR-1 or (7805 + parts)</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> Addon:RS232
( ST232CN + parts)</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> Microchip
16F886 with Tiny bootloader</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> 20x4
LCD Vishay L020N4AYYHET or equivalent</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> Digital Pot.CAT5113LI-10-G</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> Oshonsoft
PicSimIde Basic compiler</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> Tiny
Bootloader</span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="font-family: inherit;"> PC
with a RS232 port</span></div>
</li>
</ol>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;"><br /></span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;">The LCD used in our setup
has a SIP connector at the top of the display similar to the Vishay
part above. The sip can be plugged directly into the slbb or use
adapters with a ribbon cable. The Simple Menu project uses adapters.</span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;"><br /></span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;">If a 7805 regulator will
be used in your setup, then a 7.5VDC wart may be needed. This can be
determined by checking the voltage drop across the regulator. The
backlight on the LCD draws the greater power, about 200ma. If you are
having overheating, change the backlighting level or turn it off.</span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;"><br /></span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;">Step 1) Wire a basic
setup including: processor and RS232 interface. Connect a LED with
resistor from B0 to ground. The uLab28-PIC has all of this on-board.
</span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;">Step2) Compile a LED
blink routine and download to make sure bootloader and hardware are
working properly. There is a blink routine in zip file.</span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;">Step3) Complete basic
SLCD wiring while referring to Basic circuit diagram. See zip file.</span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<span style="font-family: inherit;">Step4) </span><br />
<br />
<span style="font-family: inherit;"><a href="http://arduinoprojectgroup.blogspot.com/2012/11/serial-lcd-display.html?view=flipcard">Looking for an Arduino version.</a> </span></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>PDF DATASHEETS:</b></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<a href="http://www.vishay.com/docs/37312/37312.pdf">Vishay L020N4AYYHET</a></div>
<div style="margin-bottom: 0in; margin-left: 0.31in;">
<b> </b><a href="http://www.onsemi.com/pub_link/Collateral/CAT5113-D.PDF">ON Semi. CAT5113</a></div>
<div style="margin-bottom: 0in; margin-left: -0.01in;">
<b><br /></b>
<b>LINKS:</b></div>
<div style="margin-bottom: 0in; margin-left: 0.29in;">
Tiny Bootloader</div>
<div style="margin-bottom: 0in; margin-left: 0.29in;">
Oshonsoft</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>LISTING:</b></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<b>PCB LAYOUT:</b></div>
<div style="margin-bottom: 0in; margin-left: 1.5in;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-62458966818812366092012-04-20T14:36:00.002-07:002012-04-20T16:40:33.053-07:00Rain Water Tank Level Monitor<div class="MsoNormal"><b>This a work in progress.</b><br />
<br />
Design Spec: To measure rainwater tank water level in a single tank. Two different measurement methods will be incorporated: pressure and sonic ranging. The data will be shown in height and volume. Using a battery backup realtime clock, data will be logged twice daily over the period of one year. An RS232 port will allow the data to be downloaded to a computer for analysis. A large character LCD will provide continuous display of time and water level.</div><div class="MsoNormal"><o:p></o:p></div><div class="MsoNormal"><br />
</div><div class="MsoNormal">Components<o:p></o:p></div><div class="MsoNormal">1) Two different RTC's are being tried: DS1307 and PCF8563.<o:p></o:p></div><div class="MsoNormal">2) A 24LC512 for memory storage.<o:p></o:p></div><div class="MsoNormal">3) PIC18F2520 with Tiny bootloader<o:p></o:p></div><div class="MsoNormal">4) 16x2 or 20x2 LCD: Vishay 016N002L or 020N002L<o:p></o:p></div><div class="MsoNormal"><br />
</div><div class="MsoNormal">Software<o:p></o:p></div><div class="MsoNormal">1) Basic Clock: Simple realtime clock using a RTC I2C chip. 12/24 function is included. Start time is set as part of the code.<o:p></o:p></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"> a) Clock_DS1307_LCD_2.bas<o:p></o:p></div><div class="MsoNormal"> b) Clock_PCF8563_LCD_2.bas<o:p></o:p></div><div class="MsoNormal"><br />
</div><div class="MsoNormal">2) Menu Routine: This menu routine uses 3 buttons: Select, Up, Dwn. The menu items are shown on the bottom line of the display. Execution occurs on the leading edge of button press and, following execution, waits for the button to be released. The buttons are connected to the port pins with a 10K pullup.<o:p></o:p></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"> Clock_menu_4.bas This code is not complete.<o:p></o:p></div><div class="MsoNormal"><br />
</div><div class="MsoNormal">3) Clock with Menu:<o:p></o:p><br />
<br />
In Process. Code written to date can be found <a href="http://tech.groups.yahoo.com/group/pic_sim_ide/">here</a> in files. RTC_clock.zip<br />
<br />
Notes 1) The code is written using Oshonsoft Basic for the 18F2520. From this point on I wish to switch to the 18F25K22 and use either the Swordfish (preferred) or the Amicus (Proton) Basic compiler. The Swordfish would be preferred since it uses a linking loader, so that modules can be developed much like the Arduino. Unhappily OS Basic does not as yet support the 18F25K22.</div><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAW4P0kleWAg5KLOsj7R5wdRkQmsuPEJ0aDoabjUMAif1IHYgY3aXaGQ6qJqkMOK5NMCXVsCmJiUn4GOfBIJRRoj_Fw5o_UmsL5qtuI8hM9M4SjGrA8mwbkWCH3vqS4N0uXDzh3kRZ43Ym/s1600/IMG_0301C.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAW4P0kleWAg5KLOsj7R5wdRkQmsuPEJ0aDoabjUMAif1IHYgY3aXaGQ6qJqkMOK5NMCXVsCmJiUn4GOfBIJRRoj_Fw5o_UmsL5qtuI8hM9M4SjGrA8mwbkWCH3vqS4N0uXDzh3kRZ43Ym/s320/IMG_0301C.jpg" width="258" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Rain Water Monitor Shield Prototype.</td></tr>
</tbody></table>rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-32893335607537170542012-04-18T15:05:00.000-07:002012-05-06T21:46:57.197-07:00DS30 Bootloader for the 18F25K22I have been using the Tiny bootloader for my Pic projects, but have decided to change to the DS30 bootloader mainly because of its ease of use and extensive device set.<br />
<br />
More to come.rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0tag:blogger.com,1999:blog-1606469958781427397.post-32638907358369930672012-04-18T14:42:00.001-07:002012-04-18T14:46:37.433-07:00ZIF Adapter for PicKit2I have an older Melabs serial pin programmer which I purchased with a ZIF adapter. Though the Pic processors can be programmed in situ using the ICSP connect, if it is available, during development I find it is easiest to use a ZIF socket. To that purpose a ZIF adapter has been designed for use with the PicKit2. The ZIF adapter plugs into the PicKit2 ICSP connector and a switch on the ZIF board changes Pic number of pins, i.e., 28/40 or 20 etc.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRRj5t2JVUbUPJUkquohzBKs07OevjbpRAf3iojdQTimsr5LsZGenTu5VuPbG7mh8etIfmTTtkdlRhWso60kqvSsS7nQlt_Fcr9c0fQoh7swRZ78MAIktv6OZrnWGrwssJZYZUopJiMx3s/s1600/IMG_0304C.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRRj5t2JVUbUPJUkquohzBKs07OevjbpRAf3iojdQTimsr5LsZGenTu5VuPbG7mh8etIfmTTtkdlRhWso60kqvSsS7nQlt_Fcr9c0fQoh7swRZ78MAIktv6OZrnWGrwssJZYZUopJiMx3s/s320/IMG_0304C.jpg" width="320" /></a></div><br />
<br />
At the moment I do not stock this board, but it is available from Batchpcb. The ZIF socket is available from several sources as well as the switch.<br />
<br />
BOM:<br />
<br />
<ol><li>PCB: Batchpcb, <a href="http://www.batchpcb.com/product_info.php?products_id=40478&check=bdae4d304b430a967c8392dbfc701794">ZIF PicKit2 Adapter</a></li>
<li><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 15px;">ZIF Socket: <a href="http://www.futurlec.com/">Futurlec</a>, universal 40 pin ZIF socket, ZIFU40</span></li>
<li>Switch: Mouser, <a href="http://www.mouser.com/ProductDetail/TE-Connectivity-Alcoswitch/MMS12/?qs=O2l9WfSNzun38xqHdglRr5aU2oS%2fPqpdmyi5N%2fLrYYs%3d">Slide Switch</a></li>
</ol>rinthesunhttp://www.blogger.com/profile/14214917278482595763noreply@blogger.com0