-
Content Count
255 -
Joined
-
Last visited
-
Days Won
2
Reputation Activity
-
chibiace got a reaction from BlackAngel in Nokia 5110 LCD ADC Graph
Hey, here is a little piece of code i cobbled together so that i could visualize my adc input and get a value reading along with it.
when the line reaches the end of the screen it starts again from the beginning and erases the old line, which was the simplest way i could think of doing it
the communication is bitbang and works on msp430g2231 and barely fits on there, tips on how to slim down my flashed code size would be very welcome.
thanks to other members on this forum whom i borrowed small bits and pieces from.
very fun to adjust the delays and amount of samples to see sine waves appear from a floating input pin.
main.c:
#include "msp430g2231.h" /* Program for MSP430G2231 to display a Graph,ADC and Voltage on a Nokia 5110 Lcd _____ VCC -| M G |- GND SCLK -| S 2 |- NC DIN -| P 2 |- NC DC -| 4 3 |- TEST CE -| 3 1 |- RESET RST -| 0 |- NC LED -|_____|- ADC */ //Define Pins for LCD + Backlight LED and ADC #define SCLK BIT0 #define DIN BIT1 #define DC BIT2 #define CE BIT3 #define RST BIT4 #define LED BIT5 #define ADC BIT6 //Font for ADC and Voltage Display static const char font[][5] = { {0x40, 0x5f, 0x51, 0x5f, 0x40} //0 ,{0x40, 0x40, 0x40, 0x5f, 0x40} //1 ,{0x40, 0x5d, 0x55, 0x57, 0x40} //2 ,{0x40, 0x55, 0x55, 0x5f, 0x40} //3 ,{0x40, 0x47, 0x44, 0x5f, 0x40} //4 ,{0x40, 0x57, 0x55, 0x5d, 0x40} //5 ,{0x40, 0x5f, 0x55, 0x5d, 0x40} //6 ,{0x40, 0x41, 0x41, 0x5f, 0x40} //7 ,{0x40, 0x5f, 0x55, 0x5f, 0x40} //8 ,{0x40, 0x47, 0x45, 0x5f, 0x40} //9 ,{0x40, 0x5e, 0x45, 0x5e, 0x40} //A ,{0x40, 0x5f, 0x51, 0x4e, 0x40} //D ,{0x40, 0x5f, 0x51, 0x51, 0x40} //C ,{0x40, 0x4f, 0x50, 0x4f, 0x40} //V }; const int write = 1; const int instruction = 0; void init(void); void clear(void); void shift(unsigned int, unsigned char); void cha(unsigned int ch); int main(void) { //Change me to suit. unsigned int samples = 5; unsigned int sampledelay = 1200; unsigned int loopdelay = 60000; //delay cycles unsigned int supplyvoltage = 3600; //mV //Int Hell int e;int i;unsigned int b=0b00000001;unsigned int j=0;int h;unsigned int l=5; //Arduino Value Map long map(long x, long in_min, long in_max, long out_min, long out_max) {return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;} //Disable Watchdog Timer WDTCTL = WDTPW + WDTHOLD; //Pin Directions P1DIR |= SCLK+DIN+DC+CE+RST+LED;; P1OUT |= LED; //ADC Setup Channel 2, ADC10CLK/4 ADC10CTL1 = INCH_6 + ADC10DIV_3 ; //Vcc & Vss as reference ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE; ADC10AE0 |= ADC; ADC10CTL0 |= ENC + ADC10SC; init(); clear(); //Set Cursor shift(instruction, 0x40 | 0); shift(instruction, 0x80 | 0); //Draw Font cha(10); //A cha(11); //D cha(12); //C shift(write, 0x4A); //: for(e=0;e<34;e++){shift(write, 0x40);} //_____ cha(13); //V: shift(write, 0x4A); //: for(e=0;e<32;e++){shift(write, 0x40);} //_____ //Main Program Loop while(1){ //ADC Read e=0; for(i=0;i<samples;i++){ ADC10CTL0 |= ADC10SC; while(ADC10CTL1 & ADC10BUSY); e=e+ADC10MEM; __delay_cycles(sampledelay); } e=e/samples; //Map ADC to graph e=map(ADC10MEM,0,1023,0,40); //Write ADC and Voltage values shift(instruction, 0x40 | 0); shift(instruction, 0x80 | 20); cha((ADC10MEM)/1000%10); cha((ADC10MEM)/100%10); cha((ADC10MEM)/10%10); cha((ADC10MEM)%10); shift(instruction, 0x80 | 60); h=(long)ADC10MEM*supplyvoltage/1023; cha(h/1000); shift(write, 0x50); //decimal point cha(h/100%10); cha(h/10%10); cha(h/1%10); //Clear lines shift(instruction, 0x40 | 1);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 2);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 3);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 4);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 5);shift(instruction, 0x80 | j);shift(write, 0x00); //Drawable values for graph if (e<=40) { if (!e) e=1; e = 40-e; b = 1<<(e%8); l = (e/8)+1; } //Set cursor at write point and write shift(instruction, 0x40 | l); shift(instruction, 0x80 | j); shift(write,; //"Scrolling" j++; if(j==85){j=0;} //Loop Delay __delay_cycles(loopdelay); }} //Clears the whole display void clear(){ int e; for(e=0;e<588;e++){shift(write,0x00);}} //Draws Font void cha(unsigned int ch){ int e; for(e = 0; e < 5; e++) { shift(write, font[ch][e]);} } void init(void){ P1OUT &= ~SCLK+DIN+DC+CE+RST; __delay_cycles(50000); P1OUT |= RST; P1OUT &= ~CE; //Sets up the display, your settings may vary: shift(instruction, 0x21); shift(instruction, 0xC5); shift(instruction, 0x12); shift(instruction, 0x20); shift(instruction, 0x09); shift(instruction, 0x0C); P1OUT |= CE; } //Serial Communication with LCD void shift(unsigned int mode, unsigned char byte){ if (mode==instruction){P1OUT &= ~DC;} else if(mode==write){P1OUT |= DC;} P1OUT &= ~CE; unsigned char i; for(i=0;i<=7;i++){ P1OUT &= ~SCLK; if(byte>127){P1OUT |= DIN;} else if(byte<128){P1OUT &= ~DIN;} P1OUT |= SCLK; byte = byte<<1; } P1OUT |= CE; }
-
chibiace got a reaction from mprairie in eagle cad library for the msp430g2553?
this should have it inside, http://www.ti.com/litv/zip/slac060e
G2XX3---N20
-
chibiace got a reaction from starkrobotics in Compiling and downloading via the command prompt
i use nano,gedit and mspdebug with
mspdebug rf2500 'prog main.elf' in a script under /usr/bin/
-
chibiace reacted to simpleavr in M-Clock build, M for Minimalist, Multi-mode or Matrix
This is my entry to the POTM Nov-Dec 2013.
Minimalist's Clock?
Multi-mode Clock?
Matrix Clock?
M-Clock
Description to follow...
-
chibiace reacted to simpleavr in M-Clock build, M for Minimalist, Multi-mode or Matrix
Minimalist Multi-mode Matrix Clock
Description
This is a multi-mode clock project based on the msp430g2432. It can be assembled with minimal parts. With limited 8x8 pixels display resolution, this 12 hour clock shows time in 6 different modes. This project is based on a older attiny 2313 project I did a few years ago.
HHMM mode, typical hours plus minutes scrolling digits with colon separator.
Seconds mode, shows only seconds.
Tix mode (shown below), led matrix is divided into quadrant, the upper quadrants shows the hour in bcd (binary coded decimal) values. they are represented by the number of dots to indicate the digits. the lower quadrants show the minute in bcd. i.e. for 5:34 it shows no dot + 5 dots on the upper half and 3 dots + 4 dots on the lower half.
Dice mode (shown below), the led matrix is divided into two set of 'dices'. with the upper pair showing hour from 1 - 12, the lower pair of dice shows minutes in 5 minute increments. i.e. for 5:35 it shows dice value upper 5 + lower 7 (5 hour, 7 x 5 min).
Binary (really it's bcd, or binary coded decimal) mode, (shown below) the hour, minute and second digits are show as binary dot on different columns in the led matrix. the columns 0 and 1 (from left) represents the hour digits, column 2 is blanked, columns 3 and 4 represent the minute digits, colum 5 is blanked, columns 6 and 7 represents the second digits.
The circuit employs row and column multiplexing to drive the leds, one row at a time, this gives a 12.5% duty cycle when "sets" of leds (8 of them in each of the 8 rows) are turn on briefly. current limiting resistors are eliminated to save breadboard estate and as we are not constantly driving individual leds, they are not going to be damaged.
The control (user interface) is also arranged so that we only use one tactile button for input. the firmware capture long button presses (press and hold) for menu rotation and normal button presses for menu selection.
By migrating this project from an AVR mcu to a msp430 mcu I had made it possible to keep time a lot more accurately. During display (i.e. led on) the project runs at 1Mhz DCO. The msp430 mcu has factory calibrated clock values. When not displaying, this project enters a LPM3 (low-power mode 3) to conserve power. At LPM3 the DCO clock cannot be used and the project switches to use a 32Khz crystal based AClk to keep time.
Features
Minimal component count, 4 parts.
Battery operated from 3V to 3.6V.
Use of watchdog timer to keep time, power-down sleep mode (LPM3) takes uA power.
32Khz crystal to keep accurate time when sleep.
Runs 1Mhz DCO calibrated clock when active (displaying time).
This is a 12H clock, not 24H and has no AM/PM indicator.
Easter egg application.
Parts list
msp430g2432 (or other G series dip 20pin devices w/ 4k+ flash)
8x8 LED matrix display (red only, this is a 3V project)
tactile button
32Khz clock crystal
2x LR44 button cell or 3V-3.6V other battery source
Application Notes
Short key press in display mode cycles through HHMM, seconds, tix, dice, binary and sleep modes.
Long press enters setup mode, subsequent long press rotates thru menu.
Menu items cycles thru 'Set Clock', 'Dimmer', 'Auto-off'.
In 'Set Clock' setup mode, short presses increment digit values (hours, minutes) and long press confirms.
In 'Dimmer' setup mode, short presses cycles through available brightness levels, long press confirms setting.
In 'Auto-off' setup mode, short presses toggle the auto-off on and off. With auto-off turned on, the clock displays time for 15 seconds and turn itself into LPM3 sleep mode to converse power. With auto-off turned off, display is on continuously.
When in sleep mode, MCU goes in power down mode, consuming less than 30uA of power, 32Khz crystal w/ watchdog timer is used to keep time. A pin interrupt is enabled to allow for wake up via tactile button. In this mode the main clock is disabled to conserve power.
Led segment multiplexing includes time delays to compensate for brightness differences for individual rows.
Breadboard Layout
the 8x8 led matrix has dot size of 1.9mm and is of common cathode, if you have common anode type, you can change a few lines in the code for adoption. see the following diagram and see if you have the right pin-outs. it appears they are quite common and if you purchase via ebay most suppliers have the same pin-out even if the model number is different.
+=====================================================+
| . . +-------------------(1)------------(1) . . |
| . . | . . . o||o (2)------------------+. . | (crystal)
| . ./ | . . \. +--+--+--+--+--+--+--+ . |. . |
| . (+) | . . o C7 C6 R1 C0 R3 C5 C3 R0 . |. . | (2xLR44 cell)
| . .\ | . . /. | b2 b3 | . |. . |
| . (+) | +--+--+--+--+--+--+--+--+--+ |. . |
| | | |G b6 b7 T R a7 a6 b5 b4 b3|| |
| | | | || | (msp430 mcu)
| | | |+ a0 a1 a2 a3 a4 a5 b0 b1 b2|| |
| . | (1) . . .+--+--+--+--+--+--+--+--+--+ |. . |
| . +----------(+) +--+--+--+--+--+--+--+ (2)+. . | (8x8 red led matrix)
| . . . . . . R4 R6 C1 C2 R7 C4 R5 R2 . . . |
| . . . . . . . . . . . . . . . . . |
| . . (1)-[ ]-(+) . . . . . . . . . . . | (tactile button)
| . . . . . . . . . . . . . . . . . |
+=====================================================+
*note: all (1)s, (2)s and (+) points are electrically connected
Schematic
MSP430G2xxx
-----------------
--------------|RESET |
| ------------|TEST |
| | | |
| | ROW5 <--|P2.0 P1.0|--> ROW4 (of LED Matrix)
/|\ | | ROW2 <--|P2.1 P1.1|--> ROW6
| _|_ | --- ROW1 <--|P2.2 P1.2|--> COL1
--o o------ COL0 <--|P2.3 P1.3|--> COL2
Button ROW0 <--|P2.4 P1.4|--> ROW7
COL3 <--|P2.5 P1.5|--> COL4
32Khz /-- COL7 <--|P2.6(XIN) P1.6|--> COL5
Crystal \-- COL6 <--|P2.7(XOUT) P1.7|--> ROW3
| |
Assembling
Follow breadboard layout and place two jumper wires on mini breadboard
Place msp430g2432 mcu
Place 32Khz crystal
Place Tactile Button
Place power source (I am using 2xLR44 w/ magnets as holders)
Finally place 8x8 led matrix on top of msp430g2432
/EDIT match clock mode description w/ photos, current build is on G2432, G2452,G2553, etc will also work.
-
chibiace got a reaction from GeekDoc in Interesting Project to port to the MSP430 - ATtiny45 project adds sound activation to PC
computers can be turned OFF???!
why not go directly into the soft power switch of the computer? then you can shutdown too.
-
chibiace reacted to bluehash in CC430 Kits Need TLC - Free to Caring Members
Following member items have been shipped.
@dubnet @grahamf72 @legailutin @chibiace
-
chibiace reacted to bluehash in [ ENDED ] Nov 2013 - Jan 2014 - 43oh Project of the Month Contest
Sponsors
It has been one year since we had the Project of the Month Contest. Many of you have requested it, so here it is. We have alot of cool sponsors this time, a big thank you to them. If you are remotely interested to sponsor the contest, please let us know at admin at 43oh dot com. We can help you work something out.
The prize list is still growing as more sponsors come in. The winners will get to choose any prize from the pool in order of 1st, 2nd, 3rd, 4th..etc. There is a greater chance of winning something this time because of the no. of prizes we have, so make sure you put your entry in. The aim of the POTM contest is for sharing and showcasing design ideas.
Prizes
(1) Logic 8 Analyzer-----------------------------------------------------Saleae
(1) Mastech MS8211N 2000 Count Handheld Digital Multimeter--Saelig
(1) PanaVise Mount Package--------------------------------------------Panavise
(1) 2" Pervasive Displays EPD - Kit-------------------------------------Pervasive Displays
(1) DLP-7970ABP NFC/RFID Reader BoosterPack------------------DLP Design
(1) $20 gift card Sparkfun/Amazon/Adafruit ---------------------------Abecederian
(1) Your choice of Design, Laser Cut by 43oh Member Fred------Fred
(2) Stellaris Launchpad Kits.---------------------------------------------Bluehash
Previous Contests
[ ENDED ]Oct 2013 - 43oh Halloween Contest
[ ENDED ] Nov-Dec 2012 - 43oh Project of the Month Contest
[ ENDED ] Nov-Dec 2011 - 43oh Project of the Month Contest
[ ENDED ] Aug-Sep 2011 - 43oh Project of the Month Contest
[ ENDED ] June 2011 - 43oh Project of the Month Contest
[ ENDED ] April 2011 - 43oh Project of the Month Contest
[ ENDED ] Dec 2010 - 43oh Project of the Month Contest
[ ENDED ] Nov 2010 - 43oh Project of the Month Contest
Last Date for entries
31st Jan, 2014
Submitting your entry
To submit your entry, make an entry into this thread with the following:
1 - A small description of your project.
2 - A picture or video of your setup
3 - Code.
4 - Schematic and board files.
5 - You will also need to make a copy of the entry under the Projects section. This will enable members to ask you questions and comment on your project.
Judging
A day after the contest ends, a poll will be created with all the project entries. Only members of the forum will be allowed to vote. Voting will run for a week.
Prize Distribution
1. Winners can choose their prize from the pool in the order they win it.
2. If there is a tie between multiple winners, the entry than made the earliest in this project thread will have priority in choosing a prize.
Simple Rules
- You must be a member of the 43oh forum at least a week before your submission.
- One entry from each member will be permitted.
- Your design has to be open source. if you can, select a license from here or here. 43oh will not claim any ownership.
- Your project can be anything based around the MSP430. You may interface the MSP430 to another controller. But try to keep it as the main controller.
- You may reuse code from anywhere as long as you give credit to the original author.
- You must submit code and schematics of your project with a proper description.
- You can submit your MSP430 project, if it was created before the annoucement of the contest.
- You must have at least 5 posts in the forums, for your entry to be considered when the voting begins.
- Previous entries in other 43oh contests will not be permitted.
Projects
See third post.
-
chibiace got a reaction from jayachar88 in Control 4 electromagnetic relays
simple. common transistors like pn2222 should work.
msp430 pin is the arduino pin etc. 5v to switch the relay up the top. connect the grounds together on your 5v and msp430's 3v supply. can also add a capacitor next to the diode if getting noise issues
-
chibiace reacted to swampdonkeykami in CHEAP air cylinder positioning with 43oh and flow meter
Hi Guys! I've been toying with an idea, that I didn't think would work, and set up a test jig.
Using an air compressor, a solenoid valve, a flow meter and a 43oh I found that we can get a repeatable cylinder position, like +-2.5 mm!
The flow meter is measuring the volume of air that we've fed to the cylinder and the 43oh opens or closes a solenoid valve depending on the cylinder position.http://arduinoforgoodnotevil.blogspot.ca/2013/10/accurate-ish-pneumatic-cylinder.html
-
chibiace reacted to bluehash in CC430 Kits Need TLC - Free to Caring Members
Ok everyone, very big news to all those who registered for giving this kit some TLC.
There was some mis-communication about the kits and TI came forward with free "Full Working($149)" kits for everyone who registered here!!. I have 13 kits for all those who offered some TLC for the kits.
I may need a little help on shipping as these boxes are a little big.
Big thanks to Dang Dung and William Cooper, @@adrianF at TI. Thank you for helping us out.
@@chibiace @@cubeberg @@JWoodrell @@Rubi @@Automate @@grahamf72 @@oPossum @@dubnet @@roadrunner84 @@abecedarian @@rockets4kids @@legailutin @@Rickta59
-
chibiace reacted to bluehash in 50% off on Motor Control($2.50) and Prototype($2.50) BoosterPacks
For a limited time, upto September 30th, 2013, Motor Control and Prototype BoosterPacks are on sale for 50%.
No coupon code necessary, just plain easy checkout.
Store links:
MSP430 Launchpad Motor Control BoosterPack PCB
MSP430 Launchpad Prototyping PCB
-
chibiace reacted to JWoodrell in ?Terminal
[update]
have text displaying in 3 sizes now (1,2,and 3 bytes tall, although the 2 and 3 byte tall font takes up a CHUNK of memory for the bitmaps (around 1.5k for the 2 byte tall, and around 3k for the 3 byte tall. so if all 3 sizes are enabled then it takes up about 5k of memory.)
also have preliminary work done on displaying an image at an arbitrary pixel height. but the display breaks sometimes when you feed a certain byte into the image data. and it makes no sense, the display code is exactly the same, and it isn't a timing thing. so I'm stumped :-(
see the most for more info
Video of the ball bouncing around you can see the byte boundries by the black box that follows the ball around (this is the true "image" being written to the screen, im just reediting it every frame to move the image within the image.
[/update]
ok, got the screen brightness sorted out with the help of Bluehash.
Here is the ? terminal booster running on the ? launchpad platform. powered by a 100mAh lipo battery. the screen is the same one from "the Terminal" oled booster that bluehash made.
battery charging works through the USB port.
I am going to get the program written so it does more than just display its name. but I need to figure out the bit graphics used in the icons.h file.
the entire ? booster, and ? LP hide behind the screen itself. next version of the booster will have a tab so you can wear the thing like a nametag
side view
front view
I will run some tests to figure out current draw to see how long the battery will last, and maybe modify the current resistor to dim the screen to lower current if I need to.
-
chibiace reacted to spirilis in Why is this floating point operation eating up so much Flash?
Floating point operations are not natively supported on this processor, or really any low-end microcontroller for that matter. However, they can be simulated in integer math with the right code. CCS includes code libraries to make this happen, and they are tightly coupled with the compiler so CCS includes & uses them seamlessly when it sees you using float types. These code libraries aren't simple, and they bloat the app substantially. This will differ depending on how many different types of manipulations your code performs on floating point numbers.
To get around this, you need to implement your math purely in the domain of integer math. I am not an expert (or even all that familiar) on this topic so I will defer to others on this
Sent from my Galaxy Note II with Tapatalk 4
-
chibiace reacted to eelcor in [Tip] Nice realtime clock with the PCF8563
Hi everybody,
As a part of my long term project building wireless sensor nodes, I have been looking for a nice RTC chip. First I was drawn to the DS1307, but this part is 5V and only a clock without alarm functions. Googling to the internet I've found the PCF8563. This part is a "drop in" replacement for the DS1307, but offers a lower supply voltage (3.3V) and includes alarm functions. The chips can be sourced quite cheap from the internet and work like a charm with both 6pf and 12pf 32768kHz crystals.
A nice tutorial how to connect these things can be found using the following link: http://startingelectronics.com/beginners/start-electronics-now/tut16-arduino-clock/
It is written for the Arduino but can be adapted easily to the launchpad. Just change the LiquidCrystal pins to free pins on the Arduino and voila there you have a nice RTC that can be used for sprinkler projects or other projects. The alarm can be set on different days of the week (not a specific date), but with some program logic a calendared version should be possible.
I am thinking of writing a library out of the tutorial. Anyone interested?
Kind regards,
Eelco
-
chibiace reacted to Mark Easley TI in Stellaris LaunchPad only $7.99 on eStore
https://estore.ti.com/Stellaris-LaunchPad.aspx
TI is trying to move the Stellaris LaunchPads to make room for the new Tiva C LaunchPads. Both boards are pin for pin compatible so if you want to pick up an ARM Cortex-M4F based LaunchPad for cheap, now is a good time.
Cheers!
-
-
chibiace reacted to Mybuster in 5x5 Led Matrix With MSP430
I built a multiplexed 5x5 LED matrix. The program and the circuit diagram to mine. Video: http://www.youtube.com/watch?v=jDLuoZzRLr8
-
chibiace reacted to L.R.A in Veroboard for msp430 in my club
First i would like to clarify why i'm making this board
I'm in a robotics club. It only uses microcontrolers modules designed for basic. I wanted to change that.
I realy like Texas microcontrolers for the price and it was more easy for me to use the hardware than with arduino.
With Energia it is easy to program the basics and still learn C++ wich is a better preparation for future of the students involved.
First of all thanks for making Energia. It let me create alot of small projects wich i couldn't with arduino (problems with programing external chips). It also lets me learn C assembly little by little since MSP430 is originaly programed in that but still use C++ when i just don't know.
I'm creating like a manual for the new ones that join know how to work with C++ in Energia and basics for electronics, all in my native language. Also translating all examples to portuguese
In all that i'm also designing a Veroboard for msp430 because the launchpad is a little limited for some robots. The board includes I2C converter with mosfets, a led RGB and 1 push button. It has also lots of pins to supply current to sensors and motors with 5V, 3.3V or direct from 2 diferent power supplies.
It's in veroboard because it's the only ones it can made in the club.
I wanted to share to anyone who wants it since it doesn't need any PCB. Any sugestions are welcome
-
chibiace reacted to brainwash in Simple scope readout on 5110 display
I'm in the process of building a dual lab power supply with and the Stellaris should provide monitoring and protection shutdown.
I've ported the Adafruit LCD library to Energia LM4F (it should be easy to port to MSP430 as well) so I'm using that to display stuff in graphical format.
The code below does a few tricks that might be useful for some of you: a rolling buffer to hold the data, automatic vertical scaling between the minimum and maximum values.
As always, any kind of feedback is appreciated, I'm still a beginner.
A picture is worth a thousand words. I only have 5 points of resolution in this picture but the vertical scale is actually 20 points.
-
-
chibiace reacted to NickO in Stepper Motor BoosterPack
Hey everyone!
Here is a Stepper Motor BoosterPack I have been working on that utilizes the DRV8825. I just ordered the boards today and will be working on some code samples while I wait on them. The DRV8825 can drive one bipolar stepper motor or two DC motors. It has a 8.2-V to 45-V supply range with 2.5-A peak at 24-V. I tried to design for the full operating range of the chip while maintaining the BoosterPack size guidelines.
http://www.ti.com/product/drv8825
Let me know what you think! I am working on a BLDC Motor BoosterPack as well that I will post later.
Motor_Driver_DRV8825_BoosterPack.pdf
BOM_DRV8825_BoosterPack.txt
-
chibiace reacted to simpleavr in Nokia 5110 LCD ADC Graph
thanks for the video.
kind of disappointing to see that it's quite slow.
may be clock it up to 16mhz, and only update the numbers after one sweep?
-
chibiace reacted to simpleavr in Nokia 5110 LCD ADC Graph
nice project, how about a video. what are u using to feed the device.
eliminating the 40 if() conditions reduces the text size from 2012 to 1404 (msp430gcc)
if(e==38){b=0b00000100;l=1;}; if(e==39){b=0b00000010;l=1;}; if(e==40){b=0b00000001;l=1;}; */ if (e<=40) { if (!e) e=1; e = 40-e; b = 1<<(e%8); l = (e/8)+1; }//if may be variable e, b and l does not need to be 16bit? "unsigned char" may do (if compiler didn't already optimize them).
-
chibiace got a reaction from bluehash in Nokia 5110 LCD ADC Graph
Hey, here is a little piece of code i cobbled together so that i could visualize my adc input and get a value reading along with it.
when the line reaches the end of the screen it starts again from the beginning and erases the old line, which was the simplest way i could think of doing it
the communication is bitbang and works on msp430g2231 and barely fits on there, tips on how to slim down my flashed code size would be very welcome.
thanks to other members on this forum whom i borrowed small bits and pieces from.
very fun to adjust the delays and amount of samples to see sine waves appear from a floating input pin.
main.c:
#include "msp430g2231.h" /* Program for MSP430G2231 to display a Graph,ADC and Voltage on a Nokia 5110 Lcd _____ VCC -| M G |- GND SCLK -| S 2 |- NC DIN -| P 2 |- NC DC -| 4 3 |- TEST CE -| 3 1 |- RESET RST -| 0 |- NC LED -|_____|- ADC */ //Define Pins for LCD + Backlight LED and ADC #define SCLK BIT0 #define DIN BIT1 #define DC BIT2 #define CE BIT3 #define RST BIT4 #define LED BIT5 #define ADC BIT6 //Font for ADC and Voltage Display static const char font[][5] = { {0x40, 0x5f, 0x51, 0x5f, 0x40} //0 ,{0x40, 0x40, 0x40, 0x5f, 0x40} //1 ,{0x40, 0x5d, 0x55, 0x57, 0x40} //2 ,{0x40, 0x55, 0x55, 0x5f, 0x40} //3 ,{0x40, 0x47, 0x44, 0x5f, 0x40} //4 ,{0x40, 0x57, 0x55, 0x5d, 0x40} //5 ,{0x40, 0x5f, 0x55, 0x5d, 0x40} //6 ,{0x40, 0x41, 0x41, 0x5f, 0x40} //7 ,{0x40, 0x5f, 0x55, 0x5f, 0x40} //8 ,{0x40, 0x47, 0x45, 0x5f, 0x40} //9 ,{0x40, 0x5e, 0x45, 0x5e, 0x40} //A ,{0x40, 0x5f, 0x51, 0x4e, 0x40} //D ,{0x40, 0x5f, 0x51, 0x51, 0x40} //C ,{0x40, 0x4f, 0x50, 0x4f, 0x40} //V }; const int write = 1; const int instruction = 0; void init(void); void clear(void); void shift(unsigned int, unsigned char); void cha(unsigned int ch); int main(void) { //Change me to suit. unsigned int samples = 5; unsigned int sampledelay = 1200; unsigned int loopdelay = 60000; //delay cycles unsigned int supplyvoltage = 3600; //mV //Int Hell int e;int i;unsigned int b=0b00000001;unsigned int j=0;int h;unsigned int l=5; //Arduino Value Map long map(long x, long in_min, long in_max, long out_min, long out_max) {return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;} //Disable Watchdog Timer WDTCTL = WDTPW + WDTHOLD; //Pin Directions P1DIR |= SCLK+DIN+DC+CE+RST+LED;; P1OUT |= LED; //ADC Setup Channel 2, ADC10CLK/4 ADC10CTL1 = INCH_6 + ADC10DIV_3 ; //Vcc & Vss as reference ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE; ADC10AE0 |= ADC; ADC10CTL0 |= ENC + ADC10SC; init(); clear(); //Set Cursor shift(instruction, 0x40 | 0); shift(instruction, 0x80 | 0); //Draw Font cha(10); //A cha(11); //D cha(12); //C shift(write, 0x4A); //: for(e=0;e<34;e++){shift(write, 0x40);} //_____ cha(13); //V: shift(write, 0x4A); //: for(e=0;e<32;e++){shift(write, 0x40);} //_____ //Main Program Loop while(1){ //ADC Read e=0; for(i=0;i<samples;i++){ ADC10CTL0 |= ADC10SC; while(ADC10CTL1 & ADC10BUSY); e=e+ADC10MEM; __delay_cycles(sampledelay); } e=e/samples; //Map ADC to graph e=map(ADC10MEM,0,1023,0,40); //Write ADC and Voltage values shift(instruction, 0x40 | 0); shift(instruction, 0x80 | 20); cha((ADC10MEM)/1000%10); cha((ADC10MEM)/100%10); cha((ADC10MEM)/10%10); cha((ADC10MEM)%10); shift(instruction, 0x80 | 60); h=(long)ADC10MEM*supplyvoltage/1023; cha(h/1000); shift(write, 0x50); //decimal point cha(h/100%10); cha(h/10%10); cha(h/1%10); //Clear lines shift(instruction, 0x40 | 1);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 2);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 3);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 4);shift(instruction, 0x80 | j);shift(write, 0x00); shift(instruction, 0x40 | 5);shift(instruction, 0x80 | j);shift(write, 0x00); //Drawable values for graph if (e<=40) { if (!e) e=1; e = 40-e; b = 1<<(e%8); l = (e/8)+1; } //Set cursor at write point and write shift(instruction, 0x40 | l); shift(instruction, 0x80 | j); shift(write,; //"Scrolling" j++; if(j==85){j=0;} //Loop Delay __delay_cycles(loopdelay); }} //Clears the whole display void clear(){ int e; for(e=0;e<588;e++){shift(write,0x00);}} //Draws Font void cha(unsigned int ch){ int e; for(e = 0; e < 5; e++) { shift(write, font[ch][e]);} } void init(void){ P1OUT &= ~SCLK+DIN+DC+CE+RST; __delay_cycles(50000); P1OUT |= RST; P1OUT &= ~CE; //Sets up the display, your settings may vary: shift(instruction, 0x21); shift(instruction, 0xC5); shift(instruction, 0x12); shift(instruction, 0x20); shift(instruction, 0x09); shift(instruction, 0x0C); P1OUT |= CE; } //Serial Communication with LCD void shift(unsigned int mode, unsigned char byte){ if (mode==instruction){P1OUT &= ~DC;} else if(mode==write){P1OUT |= DC;} P1OUT &= ~CE; unsigned char i; for(i=0;i<=7;i++){ P1OUT &= ~SCLK; if(byte>127){P1OUT |= DIN;} else if(byte<128){P1OUT &= ~DIN;} P1OUT |= SCLK; byte = byte<<1; } P1OUT |= CE; }