Life's caught up with me lately, but don't worry, I'm working on something new for all of you guys :). Keep checking back!
I'm cooking something new!
Tuesday, May 24, 2011 by SJ |
0
comments
I know, I know, it's been FOREVER since I've posted anything here!
Life's caught up with me lately, but don't worry, I'm working on something new for all of you guys :). Keep checking back!
Life's caught up with me lately, but don't worry, I'm working on something new for all of you guys :). Keep checking back!
MAXDAC Library
Monday, June 7, 2010 by SJ |
4
comments
It's been a while since my last post, but I just finished working on my latest library, MAXDAC.
MAXDAC is a library for interfacing with MAX520/MAX521 Digital-Analog converters (DACs). It utilizes the Arduino's I2C connection to communicate commands to the chip.
The library is fairly simple, but contains all the commands that can be used with this chip, and (I think) is fairly easy to use.
The download (below) contains all the library files, as well as an example that demonstrates the proper syntax and formatting for the MAX520/1.
I hope you like it, and please leave a message if you have any questions or comments!
Download MAXDAC.RAR
Download MAX520/1 Datasheet
MAXDAC is a library for interfacing with MAX520/MAX521 Digital-Analog converters (DACs). It utilizes the Arduino's I2C connection to communicate commands to the chip.
The library is fairly simple, but contains all the commands that can be used with this chip, and (I think) is fairly easy to use.
The download (below) contains all the library files, as well as an example that demonstrates the proper syntax and formatting for the MAX520/1.
I hope you like it, and please leave a message if you have any questions or comments!
Download MAXDAC.RAR
Download MAX520/1 Datasheet
DigiPot Library
Saturday, May 1, 2010 by SJ |
1 comments
Today, I've released my first library: DigiPot, a library for interfacing with MCP42X1 digital potentiometers.
It's a pretty simple library, but hopefully will help people get these things working "off the shelf".
As it is my first ever attempt at a library, it's sure to have mistakes, so please tell me if you happen to find any. Also, if you see room for new features or improvements, let me know as well. Download the zipped file below, including the readme containing basic structure.
Download DigiPot.RAR
It's a pretty simple library, but hopefully will help people get these things working "off the shelf".
As it is my first ever attempt at a library, it's sure to have mistakes, so please tell me if you happen to find any. Also, if you see room for new features or improvements, let me know as well. Download the zipped file below, including the readme containing basic structure.
Download DigiPot.RAR
More progress
Thursday, April 22, 2010 by SJ |
3
comments
The ever-helpful Osgeld has solved more of my problems! It seems there were some discrepancies between a few datasheets and application notes about how to command individual pots, but everything is working now! Now that it's all working, I think I'll finally go ahead and get started on the library!
This will (hopefully) be the easy part, and I wouldn't be surprised if I finished up today (*knock on wood*).
Thanks!
-Stephen
This will (hopefully) be the easy part, and I wouldn't be surprised if I finished up today (*knock on wood*).
Thanks!
-Stephen
Progress
Wednesday, April 21, 2010 by SJ |
0
comments
After some work, I've managed to get this darned thing to fade an LED in and out!
An arduino writes values from 0-255 on Potentiometer 1 (I'm having some trouble with Pot 0, see below), and the chip then writes that value to the Pot, creating a voltage divider that fades in/out an LED! It's progress, and it's a positive sign for creating a library!
I am, however, having problems with Pot 0. For some reason, When I try sending the command bit addressing Pot 0 (B00010001), it simply doesn't work. That pot appears to be stuck on 127 (5k resistance). But, when I send the command for Pot 1 (B00010010), that pot functions fine, exactly as I expect.
Also oddly, when I send the command to write both pots (B00010011), neither work! This is very confusing.. Here's the code I'm currently using if anyone wants to give some advice:
Thanks for looking, I'll check back when I get something new happening!
-Stephen
An arduino writes values from 0-255 on Potentiometer 1 (I'm having some trouble with Pot 0, see below), and the chip then writes that value to the Pot, creating a voltage divider that fades in/out an LED! It's progress, and it's a positive sign for creating a library!
I am, however, having problems with Pot 0. For some reason, When I try sending the command bit addressing Pot 0 (B00010001), it simply doesn't work. That pot appears to be stuck on 127 (5k resistance). But, when I send the command for Pot 1 (B00010010), that pot functions fine, exactly as I expect.
Also oddly, when I send the command to write both pots (B00010011), neither work! This is very confusing.. Here's the code I'm currently using if anyone wants to give some advice:
#define sLatch 2
#define sClock 3
#define sData 4
#define commandData B00010001 // command = write to pot 0
byte data;
void setup()
{
pinMode(sLatch, OUTPUT);
pinMode(sClock, OUTPUT);
pinMode(sData, OUTPUT);
}
void loop()
{
for (int i = 0; i<256; i++) { digitalWrite(sLatch, LOW); shiftOut(sData, sClock, MSBFIRST, commandData); shiftOut(sData, sClock, MSBFIRST, i); digitalWrite(sLatch, HIGH); delay(5); } for (int i = 255; i>-1; i--) {
digitalWrite(sLatch, LOW);
shiftOut(sData, sClock, MSBFIRST, commandData);
shiftOut(sData, sClock, MSBFIRST, i);
digitalWrite(sLatch, HIGH);
delay(5);
}
}
Thanks for looking, I'll check back when I get something new happening!
-Stephen
A box on the doorstep!
by SJ |
0
comments
I came home and found this box on my doorstep! (well, OK, it wasn't open yet, but you get the idea).
Inside are the MCP4251s along with various other components. I'm getting started right away on the library, and I'll be sure to post again once I've made even a tiny amount of progress!
Keep checking back, I'm bound to get something done eventually!
Inside are the MCP4251s along with various other components. I'm getting started right away on the library, and I'll be sure to post again once I've made even a tiny amount of progress!
Keep checking back, I'm bound to get something done eventually!
Planning my first library!
Tuesday, April 20, 2010 by SJ |
4
comments
Well, I've been in the Arduino business for a little while now, and I think it's time to stop using code people have already written and try my hand at writing a library myself. I know it's a bit of a complicated procedure, but hopefully with some practice (and a little luck), I'll be able to get a good one done.
My plan is to write a library for the MCP42X1 digital potentiometer family (but more specifically, the MCP4251 which is a 2-channel 10K potentiometer). The MCP4251 in question can be found at digikey here, and the datasheet for the MCP42X1 family can be found here.
I'll need help! Osgeld has been kindly helping me out on the Arduino forums (see here) in examining the datasheet and writing some code to work for the MCP42X1. Although a library already exists for SPI digital potentiometers, the library is ill-adapted to work with the chips I'm looking at.
I've already placed an order with Digikey for the MCP4251s (along with some other miscellaneous things I found myself running low on), and expect it to arrive today or tomorrow. I'll be sure to post something about the order when it gets here, and then follow up with progress on the library.
Wish me luck!
-Stephen
Subscribe to:
Posts (Atom)