Jump to content
43oh

jsolarski

Members
  • Content Count

    568
  • Joined

  • Last visited

  • Days Won

    8

Reputation Activity

  1. Like
    jsolarski reacted to TopHatHacker in Nokia 3310 LCD and MSP430G2231   
    Hey, I just wanted to make a quick post about my new project, but I don't wana type it all out again so go check it out on my site Its just some example code of the Nokia3310 LCD running directly on the launchpad.
     
    http://tophathacker.com/


  2. Like
    jsolarski reacted to sergeymkl in MD5 hashing in pure assembly   
    THIS is an early work-in-progress, it will not work (except for the first transform).
     
    What works so far:
    - MD5 basic functions F,G,H,I (i think is optimized enaugh)
    - Selecting basic functions using a indirect call using ROM table (i think so)
    - 32-Bit addition + circular shifting function
    - getting shifting amount from ROM table
     
    - first transform of MD5 works, i compared results
    a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
     
    What is missing so far:
    - A Permutation (deciding that sequence)
    a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
    d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
    c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
    ....
    - Optimization, refactoring architecture
    - Hashing multiple blocks
     
    I'm running out of registers, so should i use discrete RAM locations or should i push
    it on the stack (i'm have PIC heritage and that CPU doesn't have real stack *g*).
     
    What is better, as i want to make this into a C callable library?
    Reason for starting this is:
    Learning MSP430 ASM and since MD5 can't compile on most MSP430 due to limitations.
     
    I decided to not make it like most C implementations where simply code is unrolled
    as my goal is minimum code density and minimum RAM usage, but i will have to
    decide, maybe refactor architecture in future
     

    #include "msp430.h" ; #define controlled include file NAME main ; module name PUBLIC main ; make the main label vissible ; outside this module ORG 0FFFEh DC16 init ; set reset vector to 'init' label // RSEG CSTACK ; pre-declaration of segment // RSEG CODE ; place program in 'CODE' segment //init: MOV #SFE(CSTACK), SP ; set up stack ORG 1100h init: MOV 09FEh, SP main: NOP ; main program MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer ; INIT MD5 STATE REGISTERS md5_init: MOV.W #md5_init_const, R4 CLR R5 EVEN md5_init_cp: MOV.W @R4+, md5_context(R5) INCD R5 CMP #0014h, R5 JNZ md5_init_cp MOV.W md5_a, R4 MOV.W md5_a+2,R5 MOV.W md5_b, R6 MOV.W md5_b+2, R7 MOV.W md5_c, R8 MOV.W md5_c+2, R9 MOV.W md5_d, R10 MOV.W md5_d+2, R11 CLR R12 ;BYTE COUTNER MOV 0, R15 ; F FUNCTION EVEN md5_loop_1: CALL #md5_transform INC R12 MOV R12,R15 RRA R15 RRA R15 CMP #64,R12 JZ $ ;; MAIN TRANSFORM FUNCTION ;; R4/R5 = A R6/R7 = B R8/R9 = C R10/R11 = D ;; R12 = CURRENT BYTE R15 = F_PTR EVEN md5_transform: PUSH R6 PUSH R7 PUSH R8 PUSH R9 PUSH R10 PUSH R11 CALL md5_ftable(R15) MOV #md5_message, R11 RLA R12 ADD md5_bytes(R12), R11 ADD @R11+, R8 ADDC @R11+, R9 MOV #md5_t, R11 ADD R12, R11 RRA R12 ADD @R11+, R8 ADDC @R11+, R9 ADD R8, R4 ADDC R9, R5 MOV.B md5_shift(R12), R11 EVEN md5_leftrotate: RLA R4 RLC R5 ADC R4 DEC R11 JNZ md5_leftrotate POP R11 POP R10 POP R9 POP R8 POP R7 POP R6 ADD R6,R4 ADDC R7,R5 RET md5_f: ;R6 = XL R7 = XH ;R8 = YL R9 = YH ;R10 = ZL R11 = ZH ;R8/R9 RETVAL AND R6, R8 AND R7, R9 ;R8/R9 = (X AND Y) BIC R6, R10 ;R8/R9 = (NOT X AND Z) BIC R7, R11 BIS R10, R8 BIS R11, R9 RET ;R6 = XL R7 = XH ;R8 = YL R9 = YH ;R10 = ZL R11 = ZH ;R8/R9 RETVAL md5_g: AND R10, R6 AND R11, R7 ;R6/R7 = (Z AND X) BIC R10, R8 ;R6/R7 = (NOT Z AND Y) BIC R11, R9 BIS R6, R8 BIS R7, R9 RET ;R6 = XL R7 = XH ;R8 = YL R9 = YH ;R10 = ZL R11 = ZH ;R8/R9 RETVAL md5_h: XOR R6, R10 XOR R7, R11 XOR R10, R8 XOR R11, R9 RET ;R6 = XL R7 = XH ;R8 = YL R9 = YH ;R10 = ZL R11 = ZH ;R8/R9 RETVAL md5_i: INV R10 INV R11 BIS R6, R10 BIS R7, R11 XOR R10, R8 XOR R11, R9 RET ;R4 = AL R5 = AH ;R6 = BL R7 = BH add_32bit: ADD R6, R4 ADDC R7, R5 RET EVEN md5_ftable: DC16 md5_f, md5_g, md5_h, md5_i EVEN md5_t: DC16 0xa478, 0xd76a, 0xb756, 0xe8c7, 0x70db, 0x2420, 0xceee, 0xc1bd, 0x0faf, 0xf57c DC16 0xc62a, 0x4787, 0x4613, 0xa830, 0x9501, 0xfd46, 0x98d8, 0x6980, 0xf7af, 0x8b44 DC16 0x5bb1, 0xffff, 0xd7be, 0x895c, 0x1122, 0x6b90, 0x7193, 0xfd98, 0x438e, 0xa679 DC16 0x0821, 0x49b4, 0x2562, 0xf61e, 0xb340, 0xc040, 0x5a51, 0x265e, 0xc7aa, 0xe9b6 DC16 0x105d, 0xd62f, 0x1453, 0x0244, 0xe681, 0xd8a1, 0xfbc8, 0xe7d3, 0xcde6, 0x21e1 DC16 0x07d6, 0xc337, 0x0d87, 0xf4d5, 0x14ed, 0x455a, 0xe905, 0xa9e3, 0xa3f8, 0xfcef DC16 0x02d9, 0x676f, 0x4c8a, 0x8d2a, 0x3942, 0xfffa, 0xf681, 0x8771, 0x6122, 0x6d9d DC16 0x380c, 0xfde5, 0xea44, 0xa4be, 0xcfa9, 0x4bde, 0x4b60, 0xf6bb, 0xbc70, 0xbebf DC16 0x7ec6, 0x289b, 0x27fa, 0xeaa1, 0x3085, 0xd4ef, 0x1d05, 0x0488, 0xd039, 0xd9d4 DC16 0x99e5, 0xe6db, 0x7cf8, 0x1fa2, 0x5665, 0xc4ac, 0x2244, 0xf429, 0xff97, 0x432a DC16 0x23a7, 0xab94, 0xa039, 0xfc93, 0x59c3, 0x655b, 0xcc92, 0x8f0c, 0xf47d, 0xffef DC16 0x5dd1, 0x8584, 0x7e4f, 0x6fa8, 0xe6e0, 0xfe2c, 0x4314, 0xa301, 0x11a1, 0x4e08 DC16 0x7e82, 0xf753, 0xf235, 0xbd3a, 0xd2bb, 0x2ad7, 0xd391, 0xeb86 EVEN md5_shift: md5_shift_f: DC8 7,12,17,22 DC8 7,12,17,22 DC8 7,12,17,22 DC8 7,12,17,22 md5_shift_g: DC8 5,9,14,20 DC8 5,9,14,20 DC8 5,9,14,20 DC8 5,9,14,20 md5_shift_h: DC8 4,11,16,23 DC8 4,11,16,23 DC8 4,11,16,23 DC8 4,11,16,23 md5_shift_i: DC8 6,10,15,21 DC8 6,10,15,21 DC8 6,10,15,21 DC8 6,10,15,21 EVEN md5_bytes: md5_bytes_f: DC16 0, 2, 4, 6 DC16 8, 10,12,14 DC16 16, 18,20,22 DC16 24,26,28,30 md5_bytes_g: DC16 2, 12,22, 0 DC16 10,20,30, 8 DC16 18,28, 6,16 DC16 26, 4, 14,24 md5_bytes_h: DC16 10,16,22,28 DC16 2, 8,14,20 DC16 26, 0, 6,12 DC16 18,24,30, 4 md5_bytes_i: DC16 0,14,28,10 DC16 24, 6,20, 2 DC16 16,30,12,26 DC16 8,22, 4,18 EVEN md5_message: DB 'TEST' ;X0 DS 0x0000, 0x8000 DS 0x0000, 0x0000 DS 0x0000, 0x0000 ;X3 DS 0x0000, 0x0000 DS 0x0000, 0x0000 DS 0x0000, 0x0000 DS 0x0000, 0x0000 ;x7 DS 0x0000, 0x0000 DS 0x0000, 0x0000 DS 0x0000, 0x0000 DS 0x0000, 0x0000 ;x11 DS 0x0000, 0x0000 DS 0x0000, 0x0000 DS 0x0000, 0x2000 DS 0x0000, 0x0000 ;15 EVEN md5_init_const: DC16 0x2301, 0x6745 DC16 0xAB89, 0xEFCD DC16 0xDCFE, 0x98BA DC16 0x5476, 0x1032 DC16 0x0000, 0x0000 ORG 0200h ;MD5 STATE REGISTERS 0-3 EVEN md5_context: md5_a: DS 4 md5_b: DS 4 md5_c: DS 4 md5_d: DS 4 md5_aux: DS 4 EVEN md5_len_bytes: DS 2 md5_len_bits: DS 4 END
  3. Like
    jsolarski reacted to Stian in Coffee maker (safety) timer.   
    Made a little project that can turn on my coffee maker and automatically turns it off after ~1 hour (safety timer).
    It's my first time coding for the MSP430, took a little time to get all the interrupt code working, so maybe it can be useful for others as boilerplate code.
     

     
    The microcontroller is connected to a cheap power outlet remote (didn't want to f#$" around with 220v and void my insurance) using two transistors, one button and one led. When the button is pressed the rf remote turns on the power to the coffee maker and start a timer. The timer blinks the led before turning the power off after ~1 hour (user can override by pressing the button again).
     
    Sourcecode and pics at: http://blagg.tadkom.net/msp430-coffeetimer
  4. Like
    jsolarski reacted to JMLB in Playing music   
    Just thought I would let you know. I took some of your code to make an awesome St-Pats hat. I found the notes to rocky road to Dublin (not sure if it was exact though) put it in a hat. I also added some lights that attempt to flash with the beat. I had only 1 evening to get this going.
     
    Thanks for the code bud made me a star
     


     


  5. Like
    jsolarski got a reaction from ttthomas in LaunchPad, ADC, and LCD   
    its most likely a serial LCD 1 data line 2 clock pin 3 enable display
  6. Like
    jsolarski reacted to RobG in 74HC4511 BCD problems   
    Sounds like pins 14 and 15 or 13 are shorted. Check your circuit, pull out the chip and measure resistance between them. That would explain half Vcc when g is high and other pin low.
    Also, in your original post you stated first that F is 1.8V but than later that it is 3.6V. So, which segments are missing when you display 4 and 6?
  7. Like
    jsolarski reacted to TopHatHacker in Hello from North Dakota   
    Hey, just wanted to poke my head in the forum and say hi.
     
    I'm a relatively new micro controller user, not in years but experience. I've dabbled in the field since i was in high school with picaxe micros. moved up to arduino, then to pic and now my new favorite is the MSP430 chips. I never really had much time but now at work someone asks "i wish i could do this" and i answer "give me a couple days, and we'll see". Most of my projects are gadgets and trinkets of the practical kind. I'm in Minot, ND and i'm looking to start a local hacker space here soon, i think i've even got the space to operate out of. I also thought i'd post up my first project so far, A countdown timer until my Uncle's 50th birthday using the nokia 3310 LCD from sparkfun (http://www.sparkfun.com/products/10168). Almost done, but attached is a picture of the LCD plugged right into the launchpad. solder on the headers, with pin 1 in the VCC, GND in P1.0 and so on. The backlight can be used (pin 8) if you jumper the dip socket and p1.6 to p2.5(not used on smaller value line chips).

  8. Like
    jsolarski reacted to bluehash in Redistribution of the Stellaris DSK files   
    Some info from google cache.
     
    Maybe these thread on e2e may be helpful for those seeking an answer:
     
    Hope this helps. I'm unsure why this was taken down, although it was a legitimate question
  9. Like
    jsolarski reacted to RobG in MSP430 Seminars   
    I came across and signed up for this free seminar organized by Arrow. They have many locations to choose from (and luckily they have one next to my office.)
  10. Like
    jsolarski reacted to RobG in 3.3V LCD Displays with 5V back-light   
    Most of 3.3V LCD displays come with 5V back-light and one way of powering it in such displays is using step up converter. There are many available, like LT1300 from LT or MAX756/856 from Maxim.
    For my display, I am using LT1300 which requires 4 additional parts only:
    L1 - 22uH inductor (10uH-22uH will work)
    C1,C2 - 47uF (47uF-100uF)
    D1 - 1N5817 Schottky diode
     

     

  11. Like
    jsolarski reacted to RobG in ADC tips   
    When working with ADC you have several options when it comes to voltage reference. First is Vcc (roughly 3.6V) and it's the worst out of all options due to many factors. Also, final result has to be calculated if you want to display it in a meaningful way. Second option is internal Vref (1.5V or 2.5V) which is much better choice but the result has to be also calculated. The third option is external Vref which is the best in my opinion because you can get better tolerance and you can choose voltage, though it adds cost and one or more external parts.
    One of the reasons that I will be using external Vref instead of internal is the choice of internal voltage, 1.5V and 2.5V. Though it is fine for some tasks, I would rather have something easier to work with. So, for my projects I have decided to get a reference that makes things easier, 2.048V. Why? Well, 10 bit ADC has 1024 bits, so to calculate actual voltage when using 2.5V ref, you have to:
    (2500mV/1024) * ADC10ME It's actually 2500/1023, but for simplicity let's use 1024
     
    If you use 2.048V ref, your calculation gets a lot simpler:
    (2048mV/1024) * ADC10MEM which can be simplified to 2 * ADC10MEM or ADC10MEM << 1
     
    There are several 2.048 chips available like LT1790-2.048 or MAX6191.
    I am using MAX6191, pin 2 is Vcc, pin 4 is GND, pin 6 is connected to P1.4, it's that easy. Extra capacitors can be added but are not required.
     
    If you used my code from this post, all you have to change is couple of lines:

    ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE + SREF_2; //and unsigned int binary = ADC10MEM << 1;
     

     
    Since max range of 2V is not really useful, I will provide an example of voltage divider in the next tip.
  12. Like
    jsolarski reacted to zeke in Best information for those new to the MSP430?   
    So, now you got a job doing hardware design and you want to use the MSP430 in your design.
     
    But you've discovered that your boss has insisted on using this "wicked cool awesome" and ancient 5V sensor because they have a bazillion in stock.
     
    "What's the problem with that?" you ask.
     
    The problem is this: the MSP430 is a 3.6V device and it doesn't have 5V tolerant I/O's. This means that you'll probably hurt the part if you put 5V into an input. Go ahead and google it. You'll find our very own OCY schooling someone on this topic back in 2008. I'll let you find the article. OCY is shy. And he's probably gonna rip me open for giving away his secret identity.
     
    So, what's the answer? SLAA148 is the answer.
     
    It will take you through the various input and output scenarios that you may face trying to interface to higher voltage systems - not just 5V.
     
    Using this information, you should be able to measure the status of a 12V power supply with the A/D inputs or figure out how to drive a 12V relay.
     
    Have a read. It's useful info.
  13. Like
    jsolarski reacted to JMLB in code snippet standard template   
    Just a thought but we could also build on the arduino IDE and ship it with mspgcc but then you loose allot of features like debugging.
     
    I also think it should support what ever the launch pad supports.
     
    I am suggesting something like this based off the arduino

    LaunchPad |--------------------------------------| libraries Hardware |--------|--------| |--------|--------------------------------| LCD Servo ect MSP Core | |-------------|-----------| | LCD.c/h Comon GCC ccs Our own wrappers for essetial code... (MSPhere?) | | | IDE idependant code GCC MSP STD CSS MSP STD
     
    just to give a general Idea. we could have empty project configured for all the ide including the right paths and files ect
    I think some thing like that would make a nice little SDK and every one can contribute
  14. Like
    jsolarski reacted to bluehash in max timer period?   
    Not the timer, but you can count the no. of ticks to get a time out. eg. count a 1 second timer 65536 times gives you 65536/60/60 = ~18t hours
  15. Like
    jsolarski reacted to RobG in 16 segment bi-color LED displays   
    I got few very nice 16 segment bi-color LED displays from ERC electronics and here's my first stab at controlling them. Additional parts are 74hc595 (2) and TPIC6C595. Displays in the movie appear dim because pretty large current limiting resistors are used, they are very bright when used with the right resistors.
    Displays are bi-color, so you can get red, green , and any color in between (yellow.)
     


  16. Like
    jsolarski reacted to bluehash in Switches: Polled or Interrupts?   
    Just found an application note by TI : Implementing An Ultralow-Power Keypad Interface with MSP430
  17. Like
    jsolarski reacted to GeoNomad in GoPro Camera Controller   
    The GoPro HD Hero camera does not have a remote shutter input, but it does have an interface bus on the back designed for an add-on LCD display and other accessories not yet available.
     
    I thought it would be interesting to interface an MSP430 to the camera to automate the taking of photos for time-lapse photography, and to add a remote control and motion detection.
     
    The easiest way to do this turned out to be the PWR/MODE button which is brought to the connector on the back. The camera has a one-button mode which will take a photo or start a video recording when the camera is powered on.
     
    I elected to use the EZ430 F2012 because I had one that I got for free a while back.

    The interface to the camera is via two wires - the pullup on the input for the power button provides enough power to run the MSP430. A 1,000 microfarad cap provides power for when the processor grounds the input to turn the camera on and off.
     

     
    The program only has to do a few things. After initializing the output and setting up the watchdog timer to interrupt every 256 mSec, it goes to sleep.
     
    On interrupt, it decides what to do next which depends on where it is in the picture taking cycle. A cycle consists of: Turn on the camera with a 250 mSec low pulse. Wait 3 seconds for the image capture. Turn off the camera with a 3 second low pulse. Flash the LED to show things are working. Wait until it is time to do it all again.
     

    //****************************************************************************** // // GoPro HD Camera Control using BUS connector // for MSP430F2012 // // Uses PWR/MODE button to wake camera up and take photo in One Button Mode // // Set SHOT_RATE for number of seconds between shots // If not using xtal control, time requires CALIBRATION // // closes PWR button for 250 mSec to wake up camera // waits 3.75 seconds for snap and store // closes PWR button for 3 seconds to turn camera off // flashes LED to indicate start of next cycle // // Peter Jennings http://benlo.com/msp430 // //****************************************************************************** #include "msp430.h" #define SHOT_RATE 60 // seconds between shots #define CALIBRATION 7 // calibration to improve accuracy #define WAITING 0 // waiting for next cycle #define STARTING 1 // button down to start #define WAITING_CAMERA 2 // waiting for camera to take pic #define STOPPING 3 // button down to stop static int tick; static int state; static int time; // seconds since last save void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1SEL |= 0x00; // P1.1 option select - just I/O P1DIR |= 0x11; // Set P1.0 P1.4 to output direction P1OUT |= 0x10; // LED off, GoPro button off BCSCTL2 |= DIVS_3; // SMCLK/8 WDTCTL = WDT_MDLY_32; // WDT Timer interval 32mS tick = 0; time = 10; // wait for cap to charge up state = WAITING; IE1 |= WDTIE; // Enable WDT interrupt 256 mSec _BIS_SR(LPM0_bits + GIE); // Enter LPM0 with interrupt } // Watchdog Timer interrupt service routine #pragma vector=WDT_VECTOR __interrupt void watchdog_timer(void) { if ( (state == STARTING) && (tick >= 1 ) ) // start takes .25 seconds { state = WAITING_CAMERA; P1OUT |= 0x10; // button up } if ( tick & 0x03 ) // most of the time { P1OUT &= ~0x01; // LED off and go back to sleep } else // about once very 1.024 seconds { time++; if ( (state == WAITING) && (time >= SHOT_RATE+CALIBRATION) ) // time for photo { P1OUT &= ~0x10; // button down time = 0; tick = 0; state = STARTING; } else if ((state == WAITING_CAMERA) && (time >= 4) ) // time to turn off { state = STOPPING; P1OUT &= ~0x10; // button down } else if ((state == STOPPING) && (time >= 7)) // should be off now { state = WAITING; P1OUT |= 0x10; // button up P1OUT |= 0x01; // LED flash to indicate done cycle } } tick++; // 256 mSec ticks }
     
    I have written no more than a few lines of code for this processor in my life and am basically unfamiliar with it. I would appreciate any pointers from those who are more familiar with the chip, both with regards to the hardware interfacing and the software program. I am sure I am missing some basic details and it would be good to correct them before other users implement these instructions. Feedback is encouraged.
     
    The complete writeup is at http://benlo.com/msp430/GoProController.html
     
    Peter
  18. Like
    jsolarski reacted to bluehash in Does anyone have this book?   
    Yes, It's MSP430 Microcontroller Basics.
  19. Like
    jsolarski reacted to bluehash in Does anyone have this book?   
    I had no idea how that happened. In case you don't mind, this is 43oh's MSP430%20State%20Machine%20Programming'>affiliate link. Feel free to use it.
  20. Like
    jsolarski got a reaction from bluehash in Addiction to buying parts   
    Yes i have an addiction to buying parts i may not ever need.....how do you cure yourself of such an addiction? Buy More Parts!!!
     
     
     
    This order has some real winners, but really what can i do with a 300baud modem lol
    if you are looking for some just odds and ends parts http://www.goldmine-elec.com/
    and if you ever need a 7400/4000 series IC this is the place to go, I think they have most of them for cheap.
    FYI I do not know how much international shipping is, but US ground is pretty cheap.......
     
     
     
     
     
    ---------------------------------------------------------------------------
    ITEM# DESCRIPTION QTY TOTAL
    ---------------------------------------------------------------------------
    G16133 Amazing Wire Glue 1.00 $3.95
    ---------------------------------------------------------------------------
    G16873A PLCC-68 Socket (Through Hole) / Brand: 1.00 $0.97
    ---------------------------------------------------------------------------
    GP28 IC Socket Assortment 1.00 $2.49
    ---------------------------------------------------------------------------
    G9303 3 Lead Piezo Disk (Pkg of 2) 2.00 $2.00
    ---------------------------------------------------------------------------
    G17892 SALE! LCD Display Assortment 1.00 $0.99
    ---------------------------------------------------------------------------
    A10224 MC14543BCP BCD-to-7 Segment Latch/Decod2.00 $1.38
    ---------------------------------------------------------------------------
    A20538 PBL3717A Bipolar Stepper Motor Driver (4.00 $4.36
    ---------------------------------------------------------------------------
    G14197 SALE! Mini Stepper Motor w/ Driver Sche4.00 $3.56
    ---------------------------------------------------------------------------
    A10025 DM7493AN Decade and Binary Counter (Nat2.00 $0.70
    ---------------------------------------------------------------------------
    A10137 74VHC943N 300 Baud Modem w/5V Supply (N2.00 $3.90
    ---------------------------------------------------------------------------
    A20010 74F164PC Serial-In Parallel-Out Shift R2.00 $1.10
    ---------------------------------------------------------------------------
     
    SUB TOTAL : $25.40
    TAX : $0.00
    SHIPPING : $4.95
    ORDER TOTAL : $30.35
  21. Like
    jsolarski reacted to infrared in f5522 shows up in Motorola Atrix MultiMedia Docks   
    The Motorola Atrix 4G is the worlds first dual core smartphone running Android OS. The uniqueness of the Atrix is the Docks that can be purchased as accessories. There is a multimedia dock that has an infrared remote control, 3 USB ports and connects to the display via a pass through HDMI cable. The phone has a Ubuntu "webtop" application that starts when plugged into the dock. (there is even a really cool laptop dock that turns the phone into a full laptop)
     
    @BlueHash I did not tear one down to find out. A dev @ http://forum.xda-developers.com/showthread.php?t=963938&page=9 specifically this post http://forum.xda-developers.com/showpost.php?p=11658048&postcount=84 tore one down and posted about the IC's inside.
     
    Now, I am not going to pay $200 for a dock that has a <$5 TI msp430 in it. So I am building my own with a launchpad. Over at XDA they are trying to get it to work without a dock at all and just an HDMI cable, using scripts and modified config files.
     
    I have it working in webtop mode with a modified USB hub. The issue is sending an ID to the Atrix (f5522 must be doing this) to determine the dock type connected to and launching the appropriate application. (for example the car dock differs by not having HDMI so webtop does not get launched, instead the car dock launches a UI specific for operating a car i.e. Nav and music streaming.)
     
    Unfortunately, Motorola axed the capability to use the applications without a dock being attached.
    I assume the f5522 is handling the host mode/peripheral mode of the Atrix USB port so that a mouse/keyboard can be wired (although bluetooth is the recommended way of attaching HID).
     
    With the f5522 firmware, I may be able to design my own dock capable of new things. Need to know how the ID pin is pulled low and when the SID is sent to the phone.
  22. Like
    jsolarski reacted to zeke in Addiction to buying parts   
    Holy Crap! That place is a GOLDMINE!!!
     
    Check this Traffic Light out.
     
    You might be able to tan yourself with 196 LED's!
     
    Time to whip out the credit card!
     
    I hate you jsolarski.

  23. Like
    jsolarski got a reaction from zeke in Addiction to buying parts   
    Yes i have an addiction to buying parts i may not ever need.....how do you cure yourself of such an addiction? Buy More Parts!!!
     
     
     
    This order has some real winners, but really what can i do with a 300baud modem lol
    if you are looking for some just odds and ends parts http://www.goldmine-elec.com/
    and if you ever need a 7400/4000 series IC this is the place to go, I think they have most of them for cheap.
    FYI I do not know how much international shipping is, but US ground is pretty cheap.......
     
     
     
     
     
    ---------------------------------------------------------------------------
    ITEM# DESCRIPTION QTY TOTAL
    ---------------------------------------------------------------------------
    G16133 Amazing Wire Glue 1.00 $3.95
    ---------------------------------------------------------------------------
    G16873A PLCC-68 Socket (Through Hole) / Brand: 1.00 $0.97
    ---------------------------------------------------------------------------
    GP28 IC Socket Assortment 1.00 $2.49
    ---------------------------------------------------------------------------
    G9303 3 Lead Piezo Disk (Pkg of 2) 2.00 $2.00
    ---------------------------------------------------------------------------
    G17892 SALE! LCD Display Assortment 1.00 $0.99
    ---------------------------------------------------------------------------
    A10224 MC14543BCP BCD-to-7 Segment Latch/Decod2.00 $1.38
    ---------------------------------------------------------------------------
    A20538 PBL3717A Bipolar Stepper Motor Driver (4.00 $4.36
    ---------------------------------------------------------------------------
    G14197 SALE! Mini Stepper Motor w/ Driver Sche4.00 $3.56
    ---------------------------------------------------------------------------
    A10025 DM7493AN Decade and Binary Counter (Nat2.00 $0.70
    ---------------------------------------------------------------------------
    A10137 74VHC943N 300 Baud Modem w/5V Supply (N2.00 $3.90
    ---------------------------------------------------------------------------
    A20010 74F164PC Serial-In Parallel-Out Shift R2.00 $1.10
    ---------------------------------------------------------------------------
     
    SUB TOTAL : $25.40
    TAX : $0.00
    SHIPPING : $4.95
    ORDER TOTAL : $30.35
  24. Like
    jsolarski reacted to RobG in [ ENDED ] April 2011 - 43oh Project of the Month Contest   
    Serial to 7 segment LED display driver v1
     
    This is a milestone for my project so I figured I will include it in this month's PotM.
    The idea behind it was to create a simple display driver which could communicate with my LaunchPad over 2 wires so I don't have to deal with shift registers, wiring, wasted ports, and display routines each time I work on a new project.
    There are 2 parts, driver board and display board. Schematic for the driver board is below, schematic for the display board is here.
    Input: 2 wire 16bit SPI
    Output: up to 8 seven segment LED displays, no decimal point (I decided not to include it with this version because 20pin chips are now available and things will get a lot easier.)
    Functions: Clear display, set single digit, set pair of digits (decimal or hex), set 4 digits (12 bit signed, but cannot show the sign, all you get is ABS,) scroll left, scroll right.
    Connector SV2 connects to display board.
    Connector SV1 allows easy pin reassignment for future I2C protocol support.
    Connector SV3: 1 - Vcc, 2 - clock, 3 - unused for SPI, 4 - data in, 5 - GND.
     




     
    Controller code

    #include "msp430g2231.h" // 0-9,A,b,c,d,E,F,blank,-,r,C,o,h,H,L,u,t,i,n,P,U,deg,= const unsigned char to7digit[32] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F, 0x77,0x7C,0x58,0x5E,0x79,0x71, 0x00,0x40,0x50,0x39,0x5C,0x74,0x76,0x38, 0x1C,0x78,0x18,0x54,0x73,0x3E,0x63,0x48}; const unsigned char digitSelector[8] = {BIT0, BIT1, BIT2, BIT3, BIT4, BIT5, BIT6, BIT7}; const unsigned char mask2 = 0xC0; const unsigned char mask1 = 0x3F; const unsigned char mask1spi = 0x5F; unsigned char tmpDIR = 0; unsigned char tmpOUT = 0; unsigned char digit = 0; unsigned char digitData[8] = {16,16,16,16,16,16,16,16}; unsigned int rxData = 0; unsigned char rxDataL = 0; unsigned char rxDataH = 0; unsigned char switchVar = 0; unsigned char negative = 0; unsigned char blankChar = 16; void main() { WDTCTL = WDTPW + WDTHOLD; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; CCTL0 = CCIE; CCR0 = 125; TACTL = TASSEL_2 + MC_1 + ID_3; P2SEL &= ~(BIT6|BIT7); USICTL0 |= USIPE7 + USIPE5; USICTL1 |= USICKPH + USICKPL + USIIE; USICTL0 &= ~USISWRST; USICNT = 16 | USI16B; __enable_interrupt(); while(1) { } } // USI interrupt service routine #pragma vector = USI_VECTOR __interrupt void USI_RX (void) { //SPI rxData = USISR; rxDataL = USISRL; rxDataH = USISRH; USICNT |= 16; switchVar = rxDataH & 0xE0; switch(switchVar) { case 0xA0: //10100AAADDDDDDDD (A0xxh-A7xxh) Set A digit to D (0-255, anything above 32 will be useless) //10101000AAADDDDD (A8xxh) Set A digit to D, pretty much as above, but limited to 32 characters //(how many meaningful can you do with 7 segment anyway?) switchVar = rxDataH & 0xF8; switch(switchVar) { case 0xA8: switchVar = rxDataL & 0xE0; switchVar >>= 5; digitData[switchVar] = rxDataL & 0x1F; break; case 0xA0: switchVar = rxDataH & 0x07; digitData[switchVar] = rxDataL; // TODO 32+ are not available at this time, will produce unexpected results break; } break; case 0x80: //100000AADDDDDDDD (80xxh-83xxh) Set 2 digits to 8 bit unsigned value (convert to BCD) A=0 digits 0-1, etc. //Value can be 0-99 (score boards with 4 sets of 2 digits?) //100001AADDDDDDDD (84xxh-87xxh) As above, but no BCD conversion, just HEX switchVar = rxDataH & 0xFC; switch(switchVar) { case 0x80: switchVar = rxDataH & 0x03; switchVar <<= 1; digitData[switchVar + 1] = blankChar; digitData[switchVar] = 0; //TODO values bigger than 99 will overflow, check and display overflow while(rxDataL > 0) { digitData[switchVar] = rxDataL % 10; rxDataL /= 10; switchVar++; } break; case 0x84: switchVar = rxDataH & 0x03; switchVar <<= 1; digitData[switchVar] = rxDataL & 0x0F; digitData[switchVar + 1] = rxDataL >> 4; break; } break; case 0xC0: //110ADDDDDDDDDDDD (Cxxxh, Dxxxh) Set 4 digits to 12 bit signed integer (convert to BCD) //A=0 digits 0-3, A=1 digits 4-7, D= signed 12 bit integer, //DP of digits 0 and 4 should be connected to "-" LEDs, //value can be 0-1999 with floating decimal point and "-" sign switchVar = 0; if(rxData & BITC) switchVar = 4; // first digit is 4 digitData[switchVar] = 0; digitData[switchVar + 1] = blankChar; digitData[switchVar + 2] = blankChar; digitData[switchVar + 3] = blankChar; rxData &= 0x0FFF; negative = 0; if(rxData & BITB) { negative = 1; rxData = -(rxData); } while(rxData > 0) { digitData[switchVar] = rxData % 10; rxData /= 10; switchVar++; } //TODO handle negative sign //decimal point has to be set with another cmd //also, when DP will determine blank digits, 0.0 0.00 break; case 0xE0: //111XXXXXXXXXXXXX (Exxxh, Fxxxh) Set configuration values like leading 0 blank, etc. switchVar = rxDataH; switch(switchVar) { case 0xE0: // set blank char to 0 blankChar = 0; break; case 0xE1: // set blank char to, well, blank blankChar = 16; break; case 0xEF: // clear display by setting all digits to blank char switchVar = 0; while(switchVar < 8) { digitData[switchVar] = blankChar; switchVar++; } break; case 0xE2: // scroll left switchVar = 7; while(switchVar > 0) { digitData[switchVar] = digitData[switchVar - 1]; switchVar--; } digitData[0] = rxDataL & 0x1F; break; case 0xE3: // scroll right switchVar = 0; while(switchVar < 7) { digitData[switchVar] = digitData[switchVar + 1]; switchVar++; } digitData[7] = rxDataL & 0x1F; break; } break; } } // Timer A0 interrupt service routine #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A (void) { P1OUT &= ~mask1spi; //spi P2OUT &= ~mask2; P1DIR &= ~mask1spi; //spi P2DIR &= ~mask2; tmpDIR = to7digit[digitData[digit]]; tmpOUT = digitSelector[digit]; if(tmpDIR & tmpOUT) tmpDIR |= BIT7; tmpDIR |= digitSelector[digit]; P1DIR |= tmpDIR & mask1spi; P1OUT |= tmpOUT & mask1spi; P2DIR |= tmpDIR & BIT7; //spi P2OUT |= tmpOUT & BIT7; //spi tmpDIR <<= 1; //spi tmpOUT <<= 1; //spi P2DIR |= tmpDIR & BIT6; //spi P2OUT |= tmpOUT & BIT6; //spi digit++; if (digit == 8) digit = 0; }
     
    Master code for testing purposes

    #include unsigned int number = 0; unsigned int digit = 0; unsigned int data = 0; void main(void) { WDTCTL = WDTPW + WDTHOLD; // ---- this is whats needed to send USICTL0 |= USIPE6 + USIPE5 + USIMST + USIOE; USICTL1 |= USICKPH + USICKPL + USIIE; USICKCTL = USIDIV_7 + USISSEL_2; USICTL0 &= ~USISWRST; USICNT = USI16B; // --------------------------------- _delay_cycles(2000); _bis_SR_register(GIE); int n = 0; int d = 0; // ------------------------- // example of how to clear display and set blank char while(n < 2) { USISRH = 0xE0; //set blank char to 0 USICNT |= 16; _delay_cycles(2500); //wait for USI to finish sending USISRH = 0xEF; //clear display USICNT |= 16; _delay_cycles(1000000); //delay 1s USISRH = 0xE1; //set blank char to "blank" USICNT |= 16; _delay_cycles(2500); USISRH = 0xEF; //clear display USICNT |= 16; _delay_cycles(1000000); n++; } // ------------------------- // ------------------------- // example of how to set single digits, scrolls through all available chars for(n = 0; n<32; n++) { //n is character number to be displayed for(d = 0; d<8; d++) { //d is digit number data = d; data <<=5; //digit number is in bits 5-7 data |= n; //char number is in bits 0-4 USISRL = data; USISRH = 0xA8; //command to set single digit USICNT |= 16; _delay_cycles(20000); } } // ------------------------- _delay_cycles(1000000); // ------------------------- // clear display USISRH = 0xE1; USICNT |= 16; _delay_cycles(2500); USISRH = 0xEF; USICNT |= 16; _delay_cycles(2500); // ------------------------- // ------------------------- // example of how to set a pair of digits // this one sets digits 2-3 to decimal representation of n // n must be in the range of 0-99 // if n is <10, left digit will be blanked with blank char. for(n = 0; n<100; n++) { USISRL = n; USISRH = 0x81; //cmd to set pair 2-3 to BCD USICNT |= 16; _delay_cycles(100000); } // ------------------------- // ------------------------- // example of how to set a pair of digits // this one sets digits 4-5 to decimal representation of n // n must be in the range of 0-99 // if n is <10, left digit will be blanked with blank char. for(n = 0; n<100; n++) { USISRL = n; USISRH = 0x82; //cmd to set pair 4-5 to BCD USICNT |= 16; _delay_cycles(50000); } // ------------------------- // ------------------------- // example of how to set a pair of digits // this one sets digits 0-1 to hex value of n // n must be in the range of 00-FF for(n = 0; n<256; n++) { USISRL = n; USISRH = 0x84; //cmd to set pair 0-1 to hex USICNT |= 16; _delay_cycles(50000); } // ------------------------- _delay_cycles(1000000); // ------------------------- // clear display USISRH = 0xEF; USICNT |= 16; _delay_cycles(2500); // ------------------------- // ------------------------- // example of how to use 12 bit value, digits 0-3 // i must in the range of -1999 to 1999 int i = 0; for(i = 0; i<2000; i+=5) { USISR = i; USISRH |= 0xC0; USICNT |= 16; _delay_cycles(20000); } // ------------------------- _delay_cycles(1000000); // ------------------------- // another example USISRH = 0xEF; USICNT |= 16; _delay_cycles(2500); const char toSend[12] = {0,15,1,30,2,3,3,2,4,31,5,25}; //digit,char,digit,char... t=23oF for(i = 0; i<12; i+=2) { USISRL = (toSend[i] << 5) | toSend[i + 1]; USISRH = 0xA8; //command to set single digit USICNT |= 16; _delay_cycles(2500); } for(i = 4; i<10; i++) { USISRL = (2 << 5) | i; USISRH = 0xA8; //command to set single digit USICNT |= 16; _delay_cycles(1000000); } // ------------------------- _delay_cycles(2000000); // ------------------------- // another example // send an array USICTL1 &= ~USIIE; USISRH = 0xEF; USICNT |= 16; _delay_cycles(2500); const char array[4] = {21,20,3,4}; //char,char,... in reversed order d = 3; // start position for(i = 0; i<4; i++) { USISRL = (d << 5) | array[i]; USISRH = 0xA8; //command to set single digit USICNT |= 16; _delay_cycles(2500); d++; } // ------------------------- _delay_cycles(1000000); // ------------------------- // scroll example for(i = 0; i<8; i++) { USISRH = 0xE3; // scroll right USISRL = 16; // new char, blank USICNT |= 16; _delay_cycles(150000); } // ------------------------- const char msg[12] = {22,14,23,23,0,16,4,3,20,21,16,16}; for(i = 0; i<12; i++) { USISRH = 0xE2; // scroll left USISRL = msg[i]; // new char from an array USICNT |= 16; _delay_cycles(150000); } _delay_cycles(1000000); const char msg2[27] = {5,14,18,26,10,23,16,25,20,16,23,14,13,16,23,10,24,27,12,21,16,28,10,13,16,16,16}; for(i = 0; i<27; i++) { USISRH = 0xE2; // scroll left USISRL = msg2[i]; // new char from an array USICNT |= 16; _delay_cycles(150000); if(i==6 || i==12 || i==20) _delay_cycles(1000000); } while(1) { } } // --- this may be used, but ISR is not required if dealing directly with IF. // USI interrupt service routine #pragma vector = USI_VECTOR __interrupt void USI_TX (void) { USICTL1 &= ~USIIFG; // logic to send could be here }
  25. Like
    jsolarski reacted to PhirePhly in [ ENDED ] April 2011 - 43oh Project of the Month Contest   
    Well someone's gotta be first:
     
    A basic battery-powered LCD clock. Tells time in 24 hour format through a 4 digit seven segment LCD. Two buttons for setting hour and minute. Running current is below 12uA, which means this thing is looking forward to a good 2.5 years running off a CR2032 coincell, like it is. With just the 100uF capacitor and no battery, it can run for more than 15 seconds, so even battery replacements can be done without loss of time, if you're fast enough.
     
    The display is wired to display full hexadecimal, so it can really be used for any project that needs a 4 digit LOW power display. A 20DIP MSP430 would probably help the power budget to a degree, removing the need for the shift register between the MSP430 and LCD driver. If only I had waited another month to build this one...


    Source code
     
    Full writeup with video and parts list
    LCDClock.c
×
×
  • Create New...