
username
-
Content Count
305 -
Joined
-
Last visited
-
Days Won
8
Reputation Activity
-
username got a reaction from MatteoGalet in Reflow Oven Booster Pack
Howdy all,
Got out of college recently so I got a tad bit more time. Figured I finish off my reflow project properly since i've been getting alot of requests for kits. I'm in the process of developing a through-hole based reflow oven kit that would be easy for any hobbyist to assemble.
Source Code: https://github.com/NateZimmer/Reflow_Oven_Kit
Schematic: Printing Print Schematic.pdf
Deluxe Kit includes and features:
- 1x 2.2" Touch LCD Display
- Discrete Cold Compensation Circuit
- A high temp low thermal mass thermocouple
- A high Current Solid State Relay
- A RGB LED
- Optional Female Header interface for launchpad
- Optional External Power interface for wall supply.
Price: 50 USD + Shipping
Standard kit includes and features:
- 1x Nokia 5110 Display
- Discrete Cold Compensation Circuit
- A high temp low thermal mass thermocouple
- A high Current Solid State Relay
- Optional Female Header interface for launchpad
- Optional External Power interface for wall supply.
Price: 40 USD + Shipping
I'll try to get a video up soon. Anyhow, standard kit is on hold for now. A couple deluxe kits would be available in a few days hopefully.
Pushed back 4 weeks so I can do some more testing, development, and get parts from china =P
-
username got a reaction from carpin in Reflow Oven Booster Pack
Howdy all,
Got out of college recently so I got a tad bit more time. Figured I finish off my reflow project properly since i've been getting alot of requests for kits. I'm in the process of developing a through-hole based reflow oven kit that would be easy for any hobbyist to assemble.
Source Code: https://github.com/NateZimmer/Reflow_Oven_Kit
Schematic: Printing Print Schematic.pdf
Deluxe Kit includes and features:
- 1x 2.2" Touch LCD Display
- Discrete Cold Compensation Circuit
- A high temp low thermal mass thermocouple
- A high Current Solid State Relay
- A RGB LED
- Optional Female Header interface for launchpad
- Optional External Power interface for wall supply.
Price: 50 USD + Shipping
Standard kit includes and features:
- 1x Nokia 5110 Display
- Discrete Cold Compensation Circuit
- A high temp low thermal mass thermocouple
- A high Current Solid State Relay
- Optional Female Header interface for launchpad
- Optional External Power interface for wall supply.
Price: 40 USD + Shipping
I'll try to get a video up soon. Anyhow, standard kit is on hold for now. A couple deluxe kits would be available in a few days hopefully.
Pushed back 4 weeks so I can do some more testing, development, and get parts from china =P
-
username got a reaction from dpharris in Reflow Oven Booster Pack
Howdy all,
Got out of college recently so I got a tad bit more time. Figured I finish off my reflow project properly since i've been getting alot of requests for kits. I'm in the process of developing a through-hole based reflow oven kit that would be easy for any hobbyist to assemble.
Source Code: https://github.com/NateZimmer/Reflow_Oven_Kit
Schematic: Printing Print Schematic.pdf
Deluxe Kit includes and features:
- 1x 2.2" Touch LCD Display
- Discrete Cold Compensation Circuit
- A high temp low thermal mass thermocouple
- A high Current Solid State Relay
- A RGB LED
- Optional Female Header interface for launchpad
- Optional External Power interface for wall supply.
Price: 50 USD + Shipping
Standard kit includes and features:
- 1x Nokia 5110 Display
- Discrete Cold Compensation Circuit
- A high temp low thermal mass thermocouple
- A high Current Solid State Relay
- Optional Female Header interface for launchpad
- Optional External Power interface for wall supply.
Price: 40 USD + Shipping
I'll try to get a video up soon. Anyhow, standard kit is on hold for now. A couple deluxe kits would be available in a few days hopefully.
Pushed back 4 weeks so I can do some more testing, development, and get parts from china =P
-
username got a reaction from Samartist in Heart Beat Counter [on LCD] - msp430g2553
I assume 2 IR LEDs then for the pulse monitoring? 1 for shinning into your finger, another for picking up the change in the received LED brightness which the variations can be observed as beats? Something like that?
Very sweet project, thanks for sharing!
-
username got a reaction from spirilis in launchpad or independant
When I was first starting up on embedded projects, the msp430 was great for prototyping. Now that i'm abit more experienced I just use the launchpad as a programer for value line chips when I use them on SMT projects. Only other time i'd touch the launchpad is for boosterpack creation.... which i'm finally about to release my first. =D
-
username reacted to oPossum in Problem combining ADC10 and USCI on G2553
The UART tx interrupt flag will be set whenever the tx buffer can accept a char. So if you are not feeding chars to the UART, then it may get stuck in the ISR.
Turn on the tx interrupt enable when you have char(s) to send, turn it back off when there are no more to send.
-
username reacted to oPossum in How to use temperature calibration data
[tipdf]SLAU144[/tipdf] chapter 24 describes the calibration data stored as TLV (tag length value) in info segment A. There are ADC values for 30C and 85C for both 1.5V and 2.5V internal reference voltages. These temperature calibration values can be used to improve the accuracy of the internal temperature sensor. There is no explanation of how to do this, so here is how to do it...
Before using calibration data it would be a good idea to validate the info segment checksum. The checksum is stored in the first word and is the negative of the XOR of all of the following words. This function will return 0 for a valid checksum.
unsigned verify_info_chk(const unsigned * const begin, const unsigned * const end) { const unsigned *p = begin + 1; // Begin at word after checksum unsigned chk = 0; // Init checksum while(p < end) chk ^= *p++; // XOR all words in segment return chk + *begin; // Add checksum - result will be zero if checksum is valid }
Each chunk of calibration data in the info segment has a unique tag. This function will search for a specified tag and return a pointer to it. It will return NULL if the tag is not found.
void const *find_tag(const unsigned * const begin, const unsigned * const end, const unsigned tag) { const unsigned *p = begin + 1; // Begin at word after checksum do { // const unsigned d = *p++; // Get a word if((d & 0xFF) == tag) return (void *)p; // Return pointer if tag matches p += (d >> 9); // Point to next tag } while(p < end); // While still within segment return 0; // Not found, return NULL pointer }
A structure would be handy for using the ADC/temperature cal data...
typedef struct { unsigned adc_gain; // ADC gain unsigned adc_offet; // ADC offset unsigned ref15; // ADC value of 1.5 volt input when using 1.5 volt reference unsigned t3015; // ADC value of 30C when using 1.5 volt reference unsigned t8515; // ADC value of 85C when using 1.5 volt reference unsigned ref25; // ADC value of 2.5 volt input when using 2.5 volt reference unsigned t3025; // ADC value of 30C when using 2.5 volt reference unsigned t8525; // ADC value of 85C when using 2.5 volt reference } TCAL;
Find tag 0x08 and setup a pointer to the struct...
const TCAL * const cal = (TCAL *)find_tag(info_seg_a, info_seg_a_end, 0x08);
Now the scale and offset values for the temperature conversion formulas can be calculated...
const long cc_scale = ((85L - 30) << 16) / (cal->t8515 - cal->t3015); const long cc_offset = -(cal->t3015 * cc_scale) + (30L << 16) + (1 << 15); const long ck_offset = cc_offset + (273.15 * (1L << 16)); const long cf_scale = ((185L - 86) << 16) / (cal->t8515 - cal->t3015); const long cf_offset = -(cal->t3015 * cf_scale) + (86L << 16) + (1 << 15);
Those formulas show the derivation, they can be simplified and combined with basic error handling. The scale and offset values will be zero if the checksum is invalid or the calibration data is not found.
const TCAL * const cal = (TCAL *)(verify_info_chk(info_seg_a, info_seg_a_end) \ ? 0 \ : find_tag(info_seg_a, info_seg_a_end, 0x08)); const long cc_scale = cal ? 3604480L / (cal->t8515 - cal->t3015) : 0; const long cf_scale = cal ? 6488064L / (cal->t8515 - cal->t3015) : 0; const long cc_offset = cal ? 1998848L - (cal->t3015 * cc_scale) : 0; const long cf_offset = cal ? 5668864L - (cal->t3015 * cf_scale) : 0; const long ck_offset = cc_offset + 17901158L;
In some cases you may want to default to the uncalibrated values...
const TCAL * const cal = (TCAL *)(verify_info_chk(info_seg_a, info_seg_a_end) \ ? 0 \ : find_tag(info_seg_a, info_seg_a_end, 0x08)); const long cc_scale = cal ? 3604480L / (cal->t8515 - cal->t3015) : 27069L; const long cf_scale = cal ? 6488064L / (cal->t8515 - cal->t3015) : 48724L; const long cc_offset = cal ? 1998848L - (cal->t3015 * cc_scale) : -18169625L; const long cf_offset = cal ? 5668864L - (cal->t3015 * cf_scale) : -30634388L; const long ck_offset = cc_offset + 17901158L;
Now the actual scaled temperature values can be calculated with the usual scale/offset formulas...
dcc = ((cc_scale * adc) + cc_offset) >> 16; // C calibrated dkc = ((cc_scale * adc) + ck_offset) >> 16; // K calibrated dfc = ((cf_scale * adc) + cf_offset) >> 16; // F calibrated
Code for Nokia 7110 that will show uncalibrated (left) and calibrated (right) temperature in F, C, and K.
main.cpp
#include #include #include "nokia7110tl.h" using namespace nokia7110; /* P1.0 Reset P1.3 Temp Sensor (Not used) P2.0 Serial Data P2.1 Backlight P2.2 Chip Select P2.3 Data/Command P2.4 Serial Clock P2.5 Button */ // P1 static const unsigned LCD_RESET = BIT0; static const unsigned RXD = BIT2; static const unsigned SWITCH = BIT3; // P2 static const unsigned LCD_DATA = BIT0; static const unsigned LCD_BACKLIGHT = BIT1; static const unsigned LCD_CE = BIT2; static const unsigned LCD_DC = BIT3; static const unsigned LCD_CLK = BIT4; static const unsigned LCD_BTN = BIT5; Nokia7110 lcd; // Print integer from -999 to 9999 using 12 x 16 font void print_int(int i, unsigned x, const unsigned y) { if(i < -999 || i > 9999) return; const unsigned e = x; x += 48; const unsigned neg = i < 0; if(neg) i = -i; div_t d; d.quot = i; do { d = div(d.quot, 10); lcd.pd12(d.rem, x -= 12, y); } while(d.quot); if(neg) lcd.pd12(14, x -= 12, y); while(x > e) lcd.pd12(10, x -= 12, y); } // Print integer from -999 to 9999 using 6 x 8 font void print_int_small(int i, unsigned x, const unsigned y) { if(i < -999 || i > 9999) return; const unsigned e = x; x += 24; const unsigned neg = i < 0; if(neg) i = -i; div_t d; d.quot = i; do { d = div(d.quot, 10); lcd.print(x -= 6, y, '0' + d.rem); } while(d.quot); if(neg) lcd.print(x -= 6, y, '-'); while(x > e) lcd.print(x -= 6, y, ' '); } #pragma vector = ADC10_VECTOR // ADC conversion complete interrupt __interrupt void ADC10_ISR(void) // { // __bic_SR_register_on_exit(LPM0_bits); // Wakeup main code } // unsigned verify_info_chk(const unsigned * const begin, const unsigned * const end) { const unsigned *p = begin + 1; // Begin at word after checksum unsigned chk = 0; // Init checksum while(p < end) chk ^= *p++; // XOR all words in segment return chk + *begin; // Add checksum - result will be zero if checksum is valid } void const *find_tag(const unsigned * const begin, const unsigned * const end, const unsigned tag) { const unsigned *p = begin + 1; // Begin at word after checksum do { // const unsigned d = *p++; // Get a word if((d & 0xFF) == tag) return (void *)p; // Return pointer if tag matches p += (d >> 9); // Point to next tag } while(p < end); // While still within segment return 0; // Not found, return NULL pointer } typedef struct { unsigned adc_gain; // ADC gain unsigned adc_offet; // ADC offset unsigned ref15; // ADC value of 1.5 volt input when using 1.5 volt reference unsigned t3015; // ADC value of 30C when using 1.5 volt reference unsigned t8515; // ADC value of 85C when using 1.5 volt reference unsigned ref25; // ADC value of 2.5 volt input when using 2.5 volt reference unsigned t3025; // ADC value of 30C when using 2.5 volt reference unsigned t8525; // ADC value of 85C when using 2.5 volt reference } TCAL; int main(void) { unsigned adc; int dc, dk, df; // Temperature in degrees C, K, and F int dcc, dkc, dfc; // Calibrated temperatures const unsigned * const info_seg_a = (unsigned *)0x10C0; // Address of info segement A const unsigned * const info_seg_a_end = info_seg_a + 32; // 32 words in each segment WDTCTL = WDTPW | WDTHOLD; P1REN = RXD | SWITCH; P1DIR = LCD_RESET; P1OUT = RXD | SWITCH | LCD_RESET; P2DIR = LCD_DC | LCD_CE | LCD_CLK | LCD_BACKLIGHT | LCD_DATA; P2REN = LCD_BTN; P2OUT = LCD_CLK | LCD_DC | LCD_CE | LCD_BACKLIGHT | LCD_BTN; ADC10CTL0 = 0; // Configure ADC ADC10CTL1 = INCH_10 | ADC10DIV_3; // ADC10CTL0 = SREF_1 | ADC10SHT_3 | REFON | ADC10ON | ADC10IE; ADC10CTL0 |= ADC10IE; // Enable ADC conversion complete interrupt // _EINT(); // Enable interrupts // const TCAL * const cal = (TCAL *)(verify_info_chk(info_seg_a, info_seg_a_end) \ ? 0 \ : find_tag(info_seg_a, info_seg_a_end, 0x08)); const long cc_scale = cal ? 3604480L / (cal->t8515 - cal->t3015) : 0; const long cf_scale = cal ? 6488064L / (cal->t8515 - cal->t3015) : 0; const long cc_offset = cal ? 1998848L - (cal->t3015 * cc_scale) : 0; const long cf_offset = cal ? 5668864L - (cal->t3015 * cf_scale) : 0; const long ck_offset = cc_offset + 17901158L; lcd.reset(); // lcd.init(); // // lcd.clear(); // // for(; { // for-ever ADC10CTL0 |= (ENC | ADC10SC); // Begin ADC conversion __bis_SR_register(LPM0_bits + GIE); // Sleep until conversion complete adc = ADC10MEM; // Read ADC // // Convert to temperature dc = ((27069L * adc) - 18169625L) >> 16; // C dk = ((27069L * adc) - 268467L) >> 16; // K df = ((48724L * adc) - 30634388L) >> 16; // F // dcc = ((cc_scale * adc) + cc_offset) >> 16; // C calibrated dkc = ((cc_scale * adc) + ck_offset) >> 16; // K calibrated dfc = ((cf_scale * adc) + cf_offset) >> 16; // F calibrated // // Display on LCD print_int(df, 0, 0); // Degrees F print_int(dfc, 48, 0); // Degrees F calibrated print_int(dc, 0, 3); // Degrees C print_int(dcc, 48, 3); // Degrees C calibrated print_int(dk, 0, 6); // Degrees K print_int(dkc, 48, 6); // Degrees K calibrated } // return 0; }
nokia7110tl.h
namespace nokia7110 { unsigned char PNONE; typedef enum { lcd_command = 0, // Array of one or more commands lcd_data = 1, // Array of one or more bytes of data lcd_data_repeat = 2 // One byte of data repeated } lcd_cmd_type; template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> struct Nokia7110 { void write(const unsigned char *cmd, unsigned len, const lcd_cmd_type type = lcd_data); void reset(void); void init(void); void home(void); void pos(unsigned char x, unsigned char y); void clear(unsigned char x = 0); void fill(unsigned x, unsigned y, unsigned w, unsigned h, unsigned char z); void bitmap(const unsigned char *bmp, signed char x, signed char y, unsigned char w, unsigned char h); inline void bitmap(const unsigned char *bmp, signed char x, signed char y) { bitmap(bmp + 2, x, y, bmp[0], bmp[1]); }; void print(char c); inline void print(unsigned char x, unsigned char y, char c) { pos(x, y); print(c); }; void print(const char *s); inline void print(unsigned char x, unsigned char y, const char *s) { pos(x, y); print(s); }; void print(const char *s, unsigned char m); void printv(unsigned char x, unsigned char y, char *s); void pd12(unsigned n, unsigned x, unsigned y); }; template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::write(const unsigned char *cmd, unsigned len, const lcd_cmd_type type) { register unsigned mask; if(&_EP != &PNONE) _EP &= ~_CE; do { mask = 0x0080; do { if(*cmd & mask) { _SP |= _DATA; _SP &= ~_CLK; } else { _SP &= ~(_CLK | _DATA); } _SP |= _CLK; mask >>= 1; } while(!(mask & 1)); if(!type) { if(&_CP == &PNONE) { __delay_cycles(_DC); } else { _CP &= ~_DC; } } if(*cmd & mask) { _SP |= _DATA; _SP &= ~_CLK; } else { _SP &= ~(_CLK | _DATA); } _SP |= _CLK; if(&_CP != &PNONE) _CP |= _DC; if(!(type & 2)) ++cmd; } while(--len); if(&_EP != &PNONE) _EP |= _CE; } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::reset(void) { if(&_RP == &PNONE) { // --- Set initial state of CLK, DC and CE as needed // * = output used for reset if(&_CP == &PNONE) { if(&_EP != &PNONE) { // CLK*, DATA, CE _EP |= _CE; } // else // CLK*, DATA } else { if(&_EP != &PNONE) { // CLK, DATA, DC*, CE if(&_SP == &_EP) { _SP |= (_CLK | _CE); } else { _SP |= _CLK; _EP |= _CE; } } else { // CLK, DATA, DC* _SP |= _CLK; } } // --- Reset pulse on CLK or DC as needed if(&_CP == &PNONE) { // No DC port, use CLK to reset _SP &= ~_CLK; __delay_cycles(_RD); _SP |= _CLK; } else { // Use DC to reset _CP &= ~_DC; __delay_cycles(_RD); _CP |= _DC; } } else { _RP &= ~_RST; if(&_EP != &PNONE) { if(&_SP == &_EP) { _SP |= (_CLK | _CE); } else { _SP |= _CLK; _EP |= _CE; } } else { _SP |= _CLK; } __delay_cycles(_RD); _RP |= _RST; } __delay_cycles(_RD); } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::init(void) { /* static const unsigned char init[] = { 0x20 | 0x01, // Function set - extended instructions enabled //0x80 | 64, // Set vop (contrast) 0 - 127 0x80 | 70, // Higher contrast improves animation 0x04 | 2, // Temperature control 0x10 | 3, // Set bias system 0x20 | 0x00, // Function set - chip active, horizontal addressing, basic instructions 0x08 | 0x04 // Display control - normal mode }; */ static const unsigned char init[] = { 0xA6, //Display: Normal 0xA3, //LCD Bias Settings: 1/7 0xA1, //ADC Selection: Reverse 0xC0, //Common Output: Normal Direction //0xC8, //Common Output: Upside Down 0x22, //Set the V5 output Voltage 0x81, //Set Electronic Volume Register 0x2E, //Power Controller Set // Booster circuit: ON // Voltage regulator circuit: ON // Voltage follower circuit: OFF 0x2F, //Power Controller Set // Voltage follower circuit: ON 0xE3, //Non-OPeration Command 0x40, //Set the start line 0xAF, //LCD On //0xA5, //Display All Points: ON 0xA4, //Display All Points: NORMAL }; write(init, sizeof(init), lcd_command); } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::home(void) { //static const unsigned char home[] = { 0x40, 0x80 }; static const unsigned char home[] = { 0xB0, 0x11, 0x02 }; write(home, sizeof(home), lcd_command); } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::pos(unsigned char x, unsigned char y) { unsigned char c[3]; /*c[0] = 0x80 | x; c[1] = 0x40 | y;*/ x += 18; c[0] = 0xB0 | y; c[1] = 0x10 | (x >> 4); c[2] = x & 0x0F; write(c, sizeof(c), lcd_command); } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::clear(unsigned char x) { #if 0 home(); write(&x, 504, lcd_data_repeat); home(); #else for(unsigned y = 0; y < 9; ++y) { pos(0, y); write(&x, 96, lcd_data_repeat); } #endif } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::fill(unsigned x, unsigned y, unsigned w, unsigned h, unsigned char z) { #if 0 unsigned yy = y + h; unsigned char c[2]; c[0] = 0x80 | x; for(;y < yy; ++y) { c[1] = 0x40 | y; write(c, sizeof(c), lcd_command); write(&z, w, lcd_data_repeat); } #else unsigned yy = y + h; unsigned char c[3]; x += 18; c[1] = 0x10 | (x >> 4); c[2] = (x & 0x0F); for(;y < yy; ++y) { c[0] = 0xB0 | y; write(c, sizeof(c), lcd_command); write(&z, w, lcd_data_repeat); } #endif } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::bitmap(const unsigned char *bmp, signed char x, signed char y, unsigned char w, unsigned char h) { unsigned char c[3]; unsigned char ww; if(x < 0) { ww = w + x; bmp -= x; x = 0; } else if(x + w >= 96) { ww = (96 - x); } else { ww = w; } /*c[0] = 0x80 | x; c[1] = 0x40 | y;*/ x += 18; c[0] = 0xB0 | y; c[1] = 0x10 | (x >> 4); c[2] = x & 0x0F; while(h--) { write(c, sizeof(c), lcd_command); write(bmp, ww); bmp += w; //++c[1]; ++c[0]; } } static const unsigned char font[96][5] = { 0x00, 0x00, 0x00, 0x00, 0x00, // 0x00, 0x00, 0x5F, 0x00, 0x00, // ! 0x00, 0x07, 0x00, 0x07, 0x00, // " 0x14, 0x7F, 0x14, 0x7F, 0x14, // # 0x24, 0x2A, 0x7F, 0x2A, 0x12, // $ 0x23, 0x13, 0x08, 0x64, 0x62, // % 0x36, 0x49, 0x56, 0x20, 0x50, // & 0x00, 0x08, 0x07, 0x03, 0x00, // ' 0x00, 0x1C, 0x22, 0x41, 0x00, // ( 0x00, 0x41, 0x22, 0x1C, 0x00, // ) 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, // * 0x08, 0x08, 0x3E, 0x08, 0x08, // + 0x00, 0x40, 0x38, 0x18, 0x00, // , 0x08, 0x08, 0x08, 0x08, 0x08, // - 0x00, 0x00, 0x60, 0x60, 0x00, // . 0x20, 0x10, 0x08, 0x04, 0x02, // / 0x3E, 0x51, 0x49, 0x45, 0x3E, // 0 0x00, 0x42, 0x7F, 0x40, 0x00, // 1 0x42, 0x61, 0x51, 0x49, 0x46, // 2 0x21, 0x41, 0x49, 0x4D, 0x33, // 3 0x18, 0x14, 0x12, 0x7F, 0x10, // 4 0x27, 0x45, 0x45, 0x45, 0x39, // 5 0x3C, 0x4A, 0x49, 0x49, 0x30, // 6 0x41, 0x21, 0x11, 0x09, 0x07, // 7 0x36, 0x49, 0x49, 0x49, 0x36, // 8 0x06, 0x49, 0x49, 0x29, 0x1E, // 9 0x00, 0x00, 0x14, 0x00, 0x00, // : 0x00, 0x00, 0x40, 0x34, 0x00, // ; 0x00, 0x08, 0x14, 0x22, 0x41, // < 0x14, 0x14, 0x14, 0x14, 0x14, // = 0x00, 0x41, 0x22, 0x14, 0x08, // > 0x02, 0x01, 0x51, 0x09, 0x06, // ? 0x3E, 0x41, 0x5D, 0x59, 0x4E, // @ 0x7C, 0x12, 0x11, 0x12, 0x7C, // A 0x7F, 0x49, 0x49, 0x49, 0x36, // B 0x3E, 0x41, 0x41, 0x41, 0x22, // C 0x7F, 0x41, 0x41, 0x41, 0x3E, // D 0x7F, 0x49, 0x49, 0x49, 0x41, // E 0x7F, 0x09, 0x09, 0x09, 0x01, // F 0x3E, 0x41, 0x49, 0x49, 0x7A, // G 0x7F, 0x08, 0x08, 0x08, 0x7F, // H 0x00, 0x41, 0x7F, 0x41, 0x00, // I 0x20, 0x40, 0x41, 0x3F, 0x01, // J 0x7F, 0x08, 0x14, 0x22, 0x41, // K 0x7F, 0x40, 0x40, 0x40, 0x40, // L 0x7F, 0x02, 0x1C, 0x02, 0x7F, // M 0x7F, 0x04, 0x08, 0x10, 0x7F, // N 0x3E, 0x41, 0x41, 0x41, 0x3E, // O 0x7F, 0x09, 0x09, 0x09, 0x06, // P 0x3E, 0x41, 0x51, 0x21, 0x5E, // Q 0x7F, 0x09, 0x19, 0x29, 0x46, // R 0x26, 0x49, 0x49, 0x49, 0x32, // S 0x01, 0x01, 0x7F, 0x01, 0x01, // T 0x3F, 0x40, 0x40, 0x40, 0x3F, // U 0x1F, 0x20, 0x40, 0x20, 0x1F, // V 0x3F, 0x40, 0x38, 0x40, 0x3F, // W 0x63, 0x14, 0x08, 0x14, 0x63, // X 0x03, 0x04, 0x78, 0x04, 0x03, // Y 0x61, 0x51, 0x49, 0x45, 0x43, // Z 0x00, 0x7F, 0x41, 0x41, 0x41, // [ 0x02, 0x04, 0x08, 0x10, 0x20, // '\' 0x00, 0x41, 0x41, 0x41, 0x7F, // ] 0x04, 0x02, 0x01, 0x02, 0x04, // ^ 0x80, 0x80, 0x80, 0x80, 0x80, // _ 0x00, 0x03, 0x07, 0x08, 0x00, // ' 0x20, 0x54, 0x54, 0x54, 0x78, // a 0x7F, 0x28, 0x44, 0x44, 0x38, // b 0x38, 0x44, 0x44, 0x44, 0x28, // c 0x38, 0x44, 0x44, 0x28, 0x7F, // d 0x38, 0x54, 0x54, 0x54, 0x18, // e 0x00, 0x08, 0x7E, 0x09, 0x02, // f 0x18, 0xA4, 0xA4, 0xA4, 0x7C, // g 0x7F, 0x08, 0x04, 0x04, 0x78, // h 0x00, 0x44, 0x7D, 0x40, 0x00, // i 0x00, 0x20, 0x40, 0x40, 0x3D, // j 0x00, 0x7F, 0x10, 0x28, 0x44, // k 0x00, 0x41, 0x7F, 0x40, 0x00, // l 0x7C, 0x04, 0x78, 0x04, 0x78, // m 0x7C, 0x08, 0x04, 0x04, 0x78, // n 0x38, 0x44, 0x44, 0x44, 0x38, // o 0xFC, 0x18, 0x24, 0x24, 0x18, // p 0x18, 0x24, 0x24, 0x18, 0xFC, // q 0x7C, 0x08, 0x04, 0x04, 0x08, // r 0x48, 0x54, 0x54, 0x54, 0x24, // s 0x04, 0x04, 0x3F, 0x44, 0x24, // t 0x3C, 0x40, 0x40, 0x20, 0x7C, // u 0x1C, 0x20, 0x40, 0x20, 0x1C, // v 0x3C, 0x40, 0x30, 0x40, 0x3C, // w 0x44, 0x28, 0x10, 0x28, 0x44, // x 0x4C, 0x90, 0x90, 0x90, 0x7C, // y 0x44, 0x64, 0x54, 0x4C, 0x44, // z 0x00, 0x08, 0x36, 0x41, 0x00, // { 0x00, 0x00, 0x77, 0x00, 0x00, // | 0x00, 0x41, 0x36, 0x08, 0x00, // } 0x02, 0x01, 0x02, 0x04, 0x02, // ~ 0x00, 0x06, 0x09, 0x09, 0x06, // degrees }; template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::print(char c) { write(&font[c - 32][0], 5); write(&font[0][0], 1); } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::print(const char *s) { while(*s) { write(&font[*s - 32][0], 5); write(&font[0][0], 1); ++s; } } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::print(const char *s, unsigned char m) { unsigned char c; while(*s) { c = font[*s - 32][0] ^ m; write(&c, 1); c = font[*s - 32][1] ^ m; write(&c, 1); c = font[*s - 32][2] ^ m; write(&c, 1); c = font[*s - 32][3] ^ m; write(&c, 1); c = font[*s - 32][4] ^ m; write(&c, 1); write(&m, 1); ++s; } } template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::printv(unsigned char x, unsigned char y, char *s) { while(*s) { pos(x, y); ++y; write(&font[*s - 32][0], 5); write(&font[0][0], 1); ++s; } } static const unsigned char num11x16[19][11 * 2] = { 0x00,0xF0,0xFC,0xFE,0x06,0x02,0x06,0xFE,0xFC,0xF0,0x00, // 0 0x00,0x07,0x1F,0x3F,0x30,0x20,0x30,0x3F,0x1F,0x07,0x00, 0x00,0x00,0x08,0x0C,0xFC,0xFE,0xFE,0x00,0x00,0x00,0x00, // 1 0x00,0x20,0x20,0x20,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x00, 0x00,0x0C,0x0E,0x06,0x02,0x02,0x86,0xFE,0x7C,0x38,0x00, // 2 0x00,0x30,0x38,0x3C,0x36,0x33,0x31,0x30,0x30,0x38,0x00, 0x00,0x0C,0x0E,0x86,0x82,0x82,0xC6,0xFE,0x7C,0x38,0x00, // 3 0x00,0x18,0x38,0x30,0x20,0x20,0x31,0x3F,0x1F,0x0E,0x00, 0x00,0x00,0xC0,0x20,0x18,0x04,0xFE,0xFE,0xFE,0x00,0x00, // 4 0x00,0x03,0x02,0x02,0x02,0x22,0x3F,0x3F,0x3F,0x22,0x02, 0x00,0x00,0x7E,0x7E,0x46,0x46,0xC6,0xC6,0x86,0x00,0x00, // 5 0x00,0x18,0x38,0x30,0x20,0x20,0x30,0x3F,0x1F,0x0F,0x00, 0x00,0xC0,0xF0,0xF8,0xFC,0x4C,0xC6,0xC2,0x82,0x00,0x00, // 6 0x00,0x0F,0x1F,0x3F,0x30,0x20,0x30,0x3F,0x1F,0x0F,0x00, 0x00,0x06,0x06,0x06,0x06,0x06,0xC6,0xF6,0x3E,0x0E,0x00, // 7 0x00,0x00,0x00,0x30,0x3C,0x0F,0x03,0x00,0x00,0x00,0x00, 0x00,0x38,0x7C,0xFE,0xC6,0x82,0xC6,0xFE,0x7C,0x38,0x00, // 8 0x00,0x0E,0x1F,0x3F,0x31,0x20,0x31,0x3F,0x1F,0x0E,0x00, 0x00,0x78,0xFC,0xFE,0x86,0x02,0x86,0xFE,0xFC,0xF8,0x00, // 9 0x00,0x00,0x00,0x21,0x21,0x31,0x1D,0x1F,0x0F,0x03,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x70,0x70,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // : 0x00,0x0E,0x0E,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // . 0x00,0x38,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xC0,0x30,0x0C,0x00,0x00,0x00,0x00, // / 0x00,0x30,0x0C,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, // - 0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x00,0x18,0x3C,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, // 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xF0,0xF8,0x0C,0x06,0x02,0x02,0x02,0x02,0x0E,0x0C,0x00, // C 0x03,0x07,0x0C,0x18,0x10,0x10,0x10,0x10,0x1C,0x0C,0x00, 0xFE,0xFE,0x42,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00, // F 0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFE,0xFE,0x40,0xE0,0xB0,0x18,0x0C,0x06,0x02,0x00,0x00, // K 0x1F,0x1F,0x00,0x00,0x01,0x03,0x06,0x0C,0x18,0x10,0x00 }; template volatile unsigned char &_EP, unsigned char _CE, volatile unsigned char &_RP, unsigned char _RST, unsigned _RD> void Nokia7110<_SP, _CLK, _DATA, _CP, _DC, _EP, _CE, _RP, _RST, _RD>::pd12(unsigned n, unsigned x, unsigned y) { pos(x, y); write(num11x16[n], 11, lcd_data); pos(x, ++y); write(num11x16[n] + 11, 11, lcd_data); } } // namespace
-
username got a reaction from Samartist in 4x4x4 LED cube, using 3 pins of MSP430 launchpad
Neat little project! Thanks for sharing
-
username reacted to Samartist in 4x4x4 LED cube, using 3 pins of MSP430 launchpad
This is my 4x4x4 led cube project, done with MSP430, using only 3 pins of MSP, the circuit diagram is shown in the photos, the hardware consists of 3 shift registers, 74595, and 4 NPN transistors...
you can learn how to make a 4x4x4 LED cube by instructables or youtube or some other sites, its easy to make...
but make sure that you make exact same connections as shown in the cicuit diagrams... or else this code won't work in the new hardware...
the hardware can be built as shown in the circuit diagram...
the code is given below, you can changes it and make your own animation with it....
main.c
this is what i have done with the cube...
-
username got a reaction from tingo in Security System 3 & Reflow Oven 3
The display is RobG's awesome 2.2" touch display.
Check out his booster pack at: http://store.43oh.com/index.php?route=product/product&product_id=107 if your interested in playing around with it.
-
username got a reaction from oPossum in MAX31855 based reflow oven controller
20-30 seconds above liquidous(217C+) is abit conservative but it regrettably relies on the type of component and their moisture sensitivity level. A popular standard/compliance regarding this is JEDEC J-STD-20.
See here:
www.jedec.org/sites/default/files/docs/jstd020d-01.pdf?
If a component is J-STD-20 compliant, it must survive the ranges stated it on page 7. A decent amount of components are compliant to this standard and some will even site the standard directly in the datasheet. However, there is likewise a decent amount of components out there that are not up to the J-STD-20 spec which means implementing a profile within that spec is dangerous unless you verify every component can handle the specified heat. For example, electrolytic caps are notorious for not being able to handle long durations above liquidous. Consequently, you can implement a more conservative profile @ less risk of damaging the components and @ perhaps more risk of not reflowing all the components properly. In contrast, you can implement a profile that does meet the spec @ the permanent and long term risk of your components. I prefer to play it more safe with regards to the components so 30-60 seconds above 217C has worked fine for me. Its a delicate balance that is up to you.
While i'm at it i'll take the opportunity to rant and say that RoHS is an example of poor government intervention in electronics under the ignorant "green" banner. While it has kept products out of landfils with leaded solder (which accounts for a very small amount of the overall lead in landfills) it has sent numerous amounts of pb-free products into landfills due to deficient solder joints. In my experience, pb-free joints are more susceptible to thermal-shock & physical shock/drop & have other fun surprises such as tin-whiskers. There is a reason why the government excludes their own products from this standard. Moral of the story is, do not use PB-Free paste unless you absolutely have to...
-
username got a reaction from cubeberg in Security System 3 & Reflow Oven 3
The display is RobG's awesome 2.2" touch display.
Check out his booster pack at: http://store.43oh.com/index.php?route=product/product&product_id=107 if your interested in playing around with it.
-
username got a reaction from bluehash in Security System 3 & Reflow Oven 3
The display is RobG's awesome 2.2" touch display.
Check out his booster pack at: http://store.43oh.com/index.php?route=product/product&product_id=107 if your interested in playing around with it.
-
username got a reaction from RobG in Best target voltage for the MSP430? 3.3v vs 3.6v?
My half cent would be to stick with 3.3V. 3.3V chips make up a large majority of the market. Luckily, the MSP430 can still maintain 16MHz at 3.3V. Its not necessarily reliable long-term to push 3.3V chips to 3.6Vs or to trust intermediate voltage levels when attempting to interface 3.6V with 5V logic. Level shifters cost a couple cents and guarantee functionality. Best to play it safe rather than the potential for random failures. TI's 3.6V micros are just TI being.... TI.. :?
-
username reacted to oPossum in 8.24 fixed point multiplication
CCSv4 (what I use) doesn't support 64 bit integers.
Using CCSv5 with -O 4 -mf 5...
Well, at least it inlined the mul824() function.
I will take on any MSP430 compiler. Guaranteed faster code or your money back. LOL
#include <msp430.h> #include <stdint.h> uint32_t mul824(uint32_t a, uint32_t { // Multiply 8.24 fixed point in a by b // Return is same type as b return (((uint64_t)a * >> 24) & 0xFFFFFFFF; } void main(void) { volatile uint32_t a = 0x01000000; volatile uint32_t b = 0x12345678; volatile uint32_t x = mul824(a, ; volatile uint32_t y = mul824(b, a); }
13 { main: c114: 120A PUSH R10 c116: 1209 PUSH R9 c118: 1208 PUSH R8 c11a: 8031 0010 SUB.W #0x0010,SP 14 volatile uint32_t a = 0x01000000; c11e: 4381 0000 CLR.W 0x0000(SP) c122: 40B1 0100 0002 MOV.W #0x0100,0x0002(SP) 15 volatile uint32_t b = 0x12345678; c128: 40B1 5678 0004 MOV.W #0x5678,0x0004(SP) c12e: 40B1 1234 0006 MOV.W #0x1234,0x0006(SP) 17 volatile uint32_t x = mul824(a, ; c134: 412C MOV.W @SP,R12 c136: 411D 0002 MOV.W 0x0002(SP),R13 c13a: 411E 0004 MOV.W 0x0004(SP),R14 c13e: 411F 0006 MOV.W 0x0006(SP),R15 c142: 12B0 C2B0 CALL #__mspabi_mpyull c146: 4C08 MOV.W R12,R8 c148: 4D09 MOV.W R13,R9 c14a: 4E0A MOV.W R14,R10 c14c: 4F0B MOV.W R15,R11 c14e: 403C 0018 MOV.W #0x0018,R12 c152: 12B0 C1F2 CALL #__mspabi_srlll c156: 4C81 0008 MOV.W R12,0x0008(SP) c15a: 4D81 000A MOV.W R13,0x000a(SP) 18 volatile uint32_t y = mul824(b, a); c15e: 411C 0004 MOV.W 0x0004(SP),R12 c162: 411D 0006 MOV.W 0x0006(SP),R13 c166: 412E MOV.W @SP,R14 c168: 411F 0002 MOV.W 0x0002(SP),R15 c16c: 12B0 C2B0 CALL #__mspabi_mpyull c170: 4C08 MOV.W R12,R8 c172: 4D09 MOV.W R13,R9 c174: 4E0A MOV.W R14,R10 c176: 4F0B MOV.W R15,R11 c178: 403C 0018 MOV.W #0x0018,R12 c17c: 12B0 C1F2 CALL #__mspabi_srlll c180: 4C81 000C MOV.W R12,0x000c(SP) c184: 4D81 000E MOV.W R13,0x000e(SP) 19 } c188: 5031 0010 ADD.W #0x0010,SP c18c: 4138 POP.W R8 c18e: 4139 POP.W R9 c190: 413A POP.W R10 c192: 4130 RET __mspabi_mpyll: c000: 120A PUSH R10 c002: 1209 PUSH R9 c004: 1208 PUSH R8 c006: 1207 PUSH R7 c008: 1206 PUSH R6 c00a: 1205 PUSH R5 c00c: 1204 PUSH R4 c00e: 8031 000C SUB.W #0x000c,SP c012: 4F06 MOV.W R15,R6 c014: 4C81 0008 MOV.W R12,0x0008(SP) c018: 4D81 0002 MOV.W R13,0x0002(SP) c01c: 4E07 MOV.W R14,R7 c01e: 4881 0006 MOV.W R8,0x0006(SP) c022: 4981 0000 MOV.W R9,0x0000(SP) c026: 4A81 0004 MOV.W R10,0x0004(SP) c02a: 4B0E MOV.W R11,R14 c02c: 430D CLR.W R13 c02e: 430F CLR.W R15 c030: 12B0 C268 CALL #__mspabi_mpyl c034: 4C0A MOV.W R12,R10 c036: 430D CLR.W R13 c038: 480E MOV.W R8,R14 c03a: 430F CLR.W R15 c03c: 460C MOV.W R6,R12 c03e: 12B0 C268 CALL #__mspabi_mpyl c042: 4C09 MOV.W R12,R9 c044: 4D04 MOV.W R13,R4 c046: 4305 CLR.W R5 c048: 4306 CLR.W R6 c04a: 470C MOV.W R7,R12 c04c: 412D MOV.W @SP,R13 c04e: 12B0 C28E CALL #__mspabi_mpyul c052: 5C09 ADD.W R12,R9 c054: 6D04 ADDC.W R13,R4 c056: 6305 ADC.W R5 c058: 6306 ADC.W R6 c05a: 411C 0002 MOV.W 0x0002(SP),R12 c05e: 411D 0004 MOV.W 0x0004(SP),R13 c062: 12B0 C28E CALL #__mspabi_mpyul c066: 5C09 ADD.W R12,R9 c068: 6D04 ADDC.W R13,R4 c06a: 6305 ADC.W R5 c06c: 6306 ADC.W R6 c06e: 5A09 ADD.W R10,R9 c070: 411C 0008 MOV.W 0x0008(SP),R12 c074: 480D MOV.W R8,R13 c076: 12B0 C28E CALL #__mspabi_mpyul c07a: 4C0A MOV.W R12,R10 c07c: 530A ADD.W #0,R10 c07e: 4D04 MOV.W R13,R4 c080: 4305 CLR.W R5 c082: 4306 CLR.W R6 c084: 6304 ADC.W R4 c086: 6305 ADC.W R5 c088: 6906 ADDC.W R9,R6 c08a: 411C 0002 MOV.W 0x0002(SP),R12 c08e: 412D MOV.W @SP,R13 c090: 12B0 C28E CALL #__mspabi_mpyul c094: 4C08 MOV.W R12,R8 c096: 4D09 MOV.W R13,R9 c098: 411D 0006 MOV.W 0x0006(SP),R13 c09c: 470C MOV.W R7,R12 c09e: 12B0 C28E CALL #__mspabi_mpyul c0a2: 4D07 MOV.W R13,R7 c0a4: 580C ADD.W R8,R12 c0a6: 4C81 000A MOV.W R12,0x000a(SP) c0aa: 6907 ADDC.W R9,R7 c0ac: 4308 CLR.W R8 c0ae: 6308 ADC.W R8 c0b0: 4309 CLR.W R9 c0b2: 6309 ADC.W R9 c0b4: 411C 0008 MOV.W 0x0008(SP),R12 c0b8: 411D 0004 MOV.W 0x0004(SP),R13 c0bc: 12B0 C28E CALL #__mspabi_mpyul c0c0: 5C81 000A ADD.W R12,0x000a(SP) c0c4: 411F 000A MOV.W 0x000a(SP),R15 c0c8: 6D07 ADDC.W R13,R7 c0ca: 6308 ADC.W R8 c0cc: 6309 ADC.W R9 c0ce: 530A ADD.W #0,R10 c0d0: 6304 ADC.W R4 c0d2: 6F05 ADDC.W R15,R5 c0d4: 6706 ADDC.W R7,R6 c0d6: 411C 0008 MOV.W 0x0008(SP),R12 c0da: 412D MOV.W @SP,R13 c0dc: 12B0 C28E CALL #__mspabi_mpyul c0e0: 4C07 MOV.W R12,R7 c0e2: 4D09 MOV.W R13,R9 c0e4: 411D 0006 MOV.W 0x0006(SP),R13 c0e8: 411C 0002 MOV.W 0x0002(SP),R12 c0ec: 12B0 C28E CALL #__mspabi_mpyul c0f0: 570C ADD.W R7,R12 c0f2: 690D ADDC.W R9,R13 c0f4: 430F CLR.W R15 c0f6: 630F ADC.W R15 c0f8: 430E CLR.W R14 c0fa: 630E ADC.W R14 c0fc: 530A ADD.W #0,R10 c0fe: 6C04 ADDC.W R12,R4 c100: 6D05 ADDC.W R13,R5 c102: 6F06 ADDC.W R15,R6 c104: 4A0C MOV.W R10,R12 c106: 440D MOV.W R4,R13 c108: 450E MOV.W R5,R14 c10a: 460F MOV.W R6,R15 c10c: 5031 000C ADD.W #0x000c,SP c110: 4030 C2E8 BR #__mspabi_func_epilog __mspabi_mpyl: c268: 120A PUSH R10 c26a: 430A CLR.W R10 c26c: 430B CLR.W R11 mpyl_add_loop: c26e: C312 CLRC c270: 100D RRC R13 c272: 100C RRC R12 c274: 2802 JLO (shift_test_mpyl) c276: 5E0A ADD.W R14,R10 c278: 6F0B ADDC.W R15,R11 shift_test_mpyl: c27a: 5E0E RLA.W R14 c27c: 6F0F RLC.W R15 c27e: 930D TST.W R13 c280: 23F6 JNE (mpyl_add_loop) c282: 930C TST.W R12 c284: 23F4 JNE (mpyl_add_loop) c286: 4A0C MOV.W R10,R12 c288: 4B0D MOV.W R11,R13 c28a: 413A POP.W R10 c28c: 4130 RET __mspabi_mpyul: c28e: 4C0B MOV.W R12,R11 c290: 4D0E MOV.W R13,R14 c292: 430F CLR.W R15 c294: 430C CLR.W R12 c296: 430D CLR.W R13 c298: C312 CLRC c29a: 100B RRC R11 c29c: 3C01 JMP (mpyul_add_loop1) mpyul_add_loop: c29e: 110B RRA R11 mpyul_add_loop1: c2a0: 2802 JLO (shift_test_mpyul) c2a2: 5E0C ADD.W R14,R12 c2a4: 6F0D ADDC.W R15,R13 shift_test_mpyul: c2a6: 5E0E RLA.W R14 c2a8: 6F0F RLC.W R15 c2aa: 930B TST.W R11 c2ac: 23F8 JNE (mpyul_add_loop) c2ae: 4130 RET __mspabi_mpyull: c2b0: 120A PUSH R10 c2b2: 1209 PUSH R9 c2b4: 1208 PUSH R8 c2b6: 4C08 MOV.W R12,R8 c2b8: 4D09 MOV.W R13,R9 c2ba: 430A CLR.W R10 c2bc: 430B CLR.W R11 c2be: 4E0C MOV.W R14,R12 c2c0: 4F0D MOV.W R15,R13 c2c2: 430E CLR.W R14 c2c4: 430F CLR.W R15 c2c6: 12B0 C000 CALL #__mspabi_mpyll c2ca: 4030 C2F0 BR #__mspabi_func_epilog_3 __mspabi_srlll: c1f2: 120A PUSH R10 c1f4: 1209 PUSH R9 c1f6: 1208 PUSH R8 c1f8: 1207 PUSH R7 c1fa: 4C07 MOV.W R12,R7 c1fc: 4B0F MOV.W R11,R15 c1fe: 9037 0011 CMP.W #0x0011,R7 c202: 380E JL ($C$L2) c204: 470E MOV.W R7,R14 c206: 831E DEC.W R14 c208: 4E0C MOV.W R14,R12 c20a: 12B0 C25E CALL #__mspabi_srai_4 c20e: F03E FFF0 AND.W #0xfff0,R14 c212: 8E07 SUB.W R14,R7 $C$L1: c214: 4908 MOV.W R9,R8 c216: 4A09 MOV.W R10,R9 c218: 4F0A MOV.W R15,R10 c21a: 430F CLR.W R15 c21c: 831C DEC.W R12 c21e: 23FA JNE ($C$L1) $C$L2: c220: 9317 CMP.W #1,R7 c222: 3807 JL ($C$L4) $C$L3: c224: C312 CLRC c226: 100F RRC R15 c228: 100A RRC R10 c22a: 1009 RRC R9 c22c: 1008 RRC R8 c22e: 8317 DEC.W R7 c230: 23F9 JNE ($C$L3) $C$L4: c232: 480C MOV.W R8,R12 c234: 490D MOV.W R9,R13 c236: 4A0E MOV.W R10,R14 c238: 4030 C2EE BR #__mspabi_func_epilog_4 __mspabi_srai: c23c: F03D 000F AND.W #0x000f,R13 c240: E03D 000F XOR.W #0x000f,R13 c244: 5D0D RLA.W R13 c246: 5D00 ADD.W R13,PC __mspabi_srai_15: c248: 110C RRA R12 __mspabi_srai_14: c24a: 110C RRA R12 __mspabi_srai_13: c24c: 110C RRA R12 __mspabi_srai_12: c24e: 110C RRA R12 __mspabi_srai_11: c250: 110C RRA R12 __mspabi_srai_10: c252: 110C RRA R12 __mspabi_srai_9: c254: 110C RRA R12 __mspabi_srai_8: c256: 110C RRA R12 __mspabi_srai_7: c258: 110C RRA R12 __mspabi_srai_6: c25a: 110C RRA R12 __mspabi_srai_5: c25c: 110C RRA R12 __mspabi_srai_4: c25e: 110C RRA R12 __mspabi_srai_3: c260: 110C RRA R12 __mspabi_srai_2: c262: 110C RRA R12 __mspabi_srai_1: c264: 110C RRA R12 c266: 4130 RET _c_int00_noexit: c2ce: 4031 0400 MOV.W #0x0400,SP c2d2: 12B0 C2F8 CALL #_system_pre_init c2d6: 930C TST.W R12 c2d8: 2402 JEQ ($C$L2) c2da: 12B0 C194 CALL #_auto_init $C$L2: c2de: 430C CLR.W R12 c2e0: 12B0 C114 CALL #main c2e4: 12B0 C2FC CALL #abort __mspabi_func_epilog: c2e8: 4134 POP.W R4 __mspabi_func_epilog_6: c2ea: 4135 POP.W R5 __mspabi_func_epilog_5: c2ec: 4136 POP.W R6 __mspabi_func_epilog_4: c2ee: 4137 POP.W R7 __mspabi_func_epilog_3: c2f0: 4138 POP.W R8 __mspabi_func_epilog_2: c2f2: 4139 POP.W R9 __mspabi_func_epilog_1: c2f4: 413A POP.W R10 c2f6: 4130 RET _system_pre_init: c2f8: 431C MOV.W #1,R12 c2fa: 4130 RET C$$EXIT, abort: c2fc: 4303 NOP $C$L1: c2fe: 3FFF JMP ($C$L1) -
username reacted to oPossum in WDT as RTC
A 1000 ms (1 second) period would be fewer interrupts than a 15.625 ms period. Once per second vs 64 times per second.
The test for limits of seconds/minutes/hours can be nested for a bit more efficiency as shown here: http://forum.43oh.com/topic/1957-software-real-time-clock-rtc-two-methods/ The limit only has to be tested when the corresponding variable is incremented.
if(++counts > 63) { counts = 0; if(++secs > 59) { secs = 0; if(++mins > 59) { mins = 0; if(++hours > 12) hours = 1; } } } -
username got a reaction from yyrkoon in WDT as RTC
XIN & XOUT are the default functionality of P2.6 & P2.7 if i'm not mistaken. By default, ACLK is set to XIN & XOUT. Furthermore, the 12pF is not necessary depending on the crystal. Finally, I didn't need 1000ms tick so I used 15.6ms. Less interrupts -> less overhead.
-
username got a reaction from yyrkoon in WDT as RTC
Normally the first thing many of us hobbyists do is disable the WDT. However, considering the very limited amount of timers on the msp430 value line series, this is quite wasteful.
Heres a simple application of the WDT as a basic RTC because godforbid we use the WDT as a WDT. in order for this to be accurate, you need an external crystal of 32.768khz
#include "stdint.h" uint8_t counts=0; uint8_t secs=0; uint8_t mins=0; uint8_t hours=0; void rtc_setup() { WDTCTL = WDT_ADLY_16; // WDT 0.015625ms or 64 Hz IE1 |= WDTIE; // Enable WDT interrupt __enable_interrupt(); } // Watchdog Timer interrupt service routine #pragma vector=WDT_VECTOR __interrupt void watchdog_timer(void) { counts++; // Interrupts every 1/64s if(counts>63) { counts=0; secs++; } if(secs>59) { mins++; secs=0; } if(mins>59) { hours =hours%12 +1; mins=0; } } void get_time(char * buffer) // format hours:mins:secs { uint8_t local_data=hours; buffer[0]= local_data/10 + '0'; local_data %=10; buffer[1]= local_data + '0'; buffer[2]= ':'; local_data =mins; buffer[3]= local_data/10 +'0'; local_data %=10; buffer[4]= local_data +'0'; buffer[5]= ':'; local_data = secs; buffer[6] = local_data/10 + '0'; local_data %= 10; buffer[7]= local_data +'0'; buffer[8]=0; } -
username got a reaction from GeekDoc in WDT as RTC
Normally the first thing many of us hobbyists do is disable the WDT. However, considering the very limited amount of timers on the msp430 value line series, this is quite wasteful.
Heres a simple application of the WDT as a basic RTC because godforbid we use the WDT as a WDT. in order for this to be accurate, you need an external crystal of 32.768khz
#include "stdint.h" uint8_t counts=0; uint8_t secs=0; uint8_t mins=0; uint8_t hours=0; void rtc_setup() { WDTCTL = WDT_ADLY_16; // WDT 0.015625ms or 64 Hz IE1 |= WDTIE; // Enable WDT interrupt __enable_interrupt(); } // Watchdog Timer interrupt service routine #pragma vector=WDT_VECTOR __interrupt void watchdog_timer(void) { counts++; // Interrupts every 1/64s if(counts>63) { counts=0; secs++; } if(secs>59) { mins++; secs=0; } if(mins>59) { hours =hours%12 +1; mins=0; } } void get_time(char * buffer) // format hours:mins:secs { uint8_t local_data=hours; buffer[0]= local_data/10 + '0'; local_data %=10; buffer[1]= local_data + '0'; buffer[2]= ':'; local_data =mins; buffer[3]= local_data/10 +'0'; local_data %=10; buffer[4]= local_data +'0'; buffer[5]= ':'; local_data = secs; buffer[6] = local_data/10 + '0'; local_data %= 10; buffer[7]= local_data +'0'; buffer[8]=0; } -
username got a reaction from izdane in Security System 3 & Reflow Oven 3
Howdy all,
School wanted acouple IR reflow ovens so I figured heck, why not make a new control board? In addition, I want to make my new security system V3 so why not combine the 2 into 1 small compact board? (besides the inevitable routing nightmare). Any review of the schematic would be appreciated. I figured i'd make 1 last project with an MSP430 but i'm tempted to put an ARM on there cause I need more GPIO and I will probably need more RAM. Many thanks to RobG for his awesome development of the 2.2" lcd display.
My new Security System V3 will use an ultrasound sensor, a infrared sensor, and a magnetic door sensor. No one is getting through my door without me knowing it XD. Will use an NRF chip to send a watch dog signal to my omega alarm box I have yet to build. Will also have a separate NRF key that will deactivate the system automatically if i'm around.
Click for full size, all values are by majority simply representational
-
-
username got a reaction from roadrunner84 in Security System 3 & Reflow Oven 3
Making some headway =D
-
username reacted to RobG in 43oh PCB Logo
How about something with reference to open hardware?
(not quite there yet, 2 min PS job, but something like this)
-
username got a reaction from keithehenry in G2553 Hardware UART "Hello World" Example
A simple well documented hardware uart "Hello World" example.
Updated, thanks for member comments 3/13/13
Notes:
This code is for launchpad rev 1.5
This is hardware UART, your launchpad jumpers must be set for hardware UART
The TI TUSB3410 is a TERRIBLE usb-> UART chip and is very buggy on WIN7 64bit. If your still having issues, it could be a driver issue. Try on XP or use a different USB -> serial device.
//Nate Zimmer UART example // Press button to print hello to terminal #include <msp430g2553.h> // System define for the micro that I am using #define RXD BIT1 //Check your launchpad rev to make sure this is the case. Set jumpers to hardware uart. #define TXD BIT2 // TXD with respect to what your sending to the computer. Sent data will appear on this line #define BUTTON BIT3 void UART_TX(char * tx_data); // Function Prototype for TX void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop Watch dog timer BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1 MHz DCOCTL = CALDCO_1MHZ; P1DIR &=~BUTTON; // Ensure button is input (sets a 0 in P1DIR register at location BIT3) P1OUT |= BUTTON; // Enables pullup resistor on button P1REN |= BUTTON; P1SEL = RXD + TXD ; // Select TX and RX functionality for P1.1 & P1.2 P1SEL2 = RXD + TXD ; // UCA0CTL1 |= UCSSEL_2; // Have USCI use System Master Clock: AKA core clk 1MHz UCA0BR0 = 104; // 1MHz 9600, see user manual UCA0BR1 = 0; // UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1 UCA0CTL1 &= ~UCSWRST; // Start USCI state machine while(1) // While 1 is equal to 1 (forever) { if(!((P1IN & BUTTON)==BUTTON)) // Was button pressed? { UART_TX("Hello World! \r\n"); // If yes, Transmit message & drink beer __delay_cycles(100000); //Debounce button so signal is not sent multiple times } } } void UART_TX(char * tx_data) // Define a function which accepts a character pointer to an array { unsigned int i=0; while(tx_data[i]) // Increment through array, look for null pointer (0) at end of string { while ((UCA0STAT & UCBUSY)); // Wait if line TX/RX module is busy with data UCA0TXBUF = tx_data[i]; // Send out element i of tx_data array on UART bus i++; // Increment variable for array address } } -
username reacted to VMM in Another 430 Watch
Hello. I figured I would share a project I've been working on since I borrowed a lot of code from this forum. It's a small watch using a g2553 and the same OLED display as "The Terminal". Thanks bluehash for the breakout, RobG and gwdeveloper for code, and others.