bluehash 1,581 Posted August 26, 2011 Share Posted August 26, 2011 Shiny! Quote Link to post Share on other sites
Mac 67 Posted August 26, 2011 Share Posted August 26, 2011 Shiny! A Firefly fan? Quote Link to post Share on other sites
RobG 1,892 Posted August 26, 2011 Author Share Posted August 26, 2011 If interested, boards only are $6.66 shipped to continental US, also available fully assembled. Quote Link to post Share on other sites
bluehash 1,581 Posted August 26, 2011 Share Posted August 26, 2011 Shiny! A Firefly fan? "This is the captain. We have a...little problem with our engine sequence, so we may experience some slight turbulence and then...explode." Quote Link to post Share on other sites
bluehash 1,581 Posted August 26, 2011 Share Posted August 26, 2011 If interested, boards only are $6.66 shipped to continental US, $13.33 fully assembled. Update your first post with this, Rob. Easier to find. Quote Link to post Share on other sites
GeekDoc 226 Posted August 26, 2011 Share Posted August 26, 2011 Shiny! A Firefly fan? "This is the captain. We have a...little problem with our engine sequence, so we may experience some slight turbulence and then...explode." ...I'll respond in "Off Topic" to avoid hijacking this thread... Quote Link to post Share on other sites
HylianSavior 37 Posted August 30, 2011 Share Posted August 30, 2011 Congrats, Rob, you're on Dangerous Prototypes! http://dangerousprototypes.com/2011/08/ ... ay-shield/ Quote Link to post Share on other sites
rpflaum 0 Posted August 30, 2011 Share Posted August 30, 2011 I would like more details on ordering these boards. Quote Link to post Share on other sites
bluehash 1,581 Posted August 30, 2011 Share Posted August 30, 2011 I would like more details on ordering these boards. See first post. Quote Link to post Share on other sites
RobG 1,892 Posted August 30, 2011 Author Share Posted August 30, 2011 Send me PM and I will send you my PayPal info. Next week I will list them on eBay (I just don't have it in me to finish my own store ) Quote Link to post Share on other sites
RobG 1,892 Posted September 4, 2011 Author Share Posted September 4, 2011 For those who got my boards, here's one example which uses USI in SPI mode to communicate with the board (bit banging can also be used, can post an example if needed.) P1.0, P1.5, and P1.6 have shorting blocks. #include unsigned int counter = 0; // Counter variable unsigned int digitCounter = 0; // Digit counter unsigned char digit = 0; // Single digit to be displayed unsigned char bcd7digit[10] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F}; // BCD to 7 digit map unsigned char digitSelector[4] = {0x08, 0x04, 0x02, 0x01}; // Digit selector map void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT P1OUT |= 0x01; // Port P1.0 will be used to latch P1DIR |= 0x01; USICTL0 |= USIPE6 + USIPE5 + USIMST + USIOE; // Out & clk enable, SPI Master USICTL1 |= USICKPH + USIIE; // Counter interrupt, flag remains set USICKCTL = USIDIV_7 + USISSEL_2; // /128 SMCLK USICTL0 &= ~USISWRST; // USI released for operation USICNT = USI16B; // Enable 16 bit CCTL0 = CCIE; // CCR0 interrupt enabled CCR0 = 500; // TACTL = TASSEL_2 + MC_1 + ID_3; // SMCLK, upmode _bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupt } // Timer A0 interrupt service routine #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A (void) { digitCounter++; // Increase digit counter digitCounter &= 0x03; // Mask, counter range is 0-3 digit = counter>>(4 * digitCounter); // Shift digits right digit &= 0x0F; // Mask, we need first digit only USISRL = bcd7digit[digit]; // Get segments from the map USISRH = digitSelector[digitCounter]; // if(digitCounter == 0) { counter = _bcd_add_short(counter, 0x01);// Decimally increase counter's when on first digit } USICNT |= 16; // Start USI } // USI interrupt service routine #pragma vector = USI_VECTOR __interrupt void USI_TXRX (void) { USICTL1 &= ~USIIFG; // Clear pending flag P1OUT &= ~0x01; // Latch data P1OUT |= 0x01; } gwdeveloper 1 Quote Link to post Share on other sites
gwdeveloper 275 Posted September 4, 2011 Share Posted September 4, 2011 Thank you for posting an example to get it going. It works perfectly. :clap: I was about " " that close to having it running on a 2553. Quote Link to post Share on other sites
RobG 1,892 Posted September 4, 2011 Author Share Posted September 4, 2011 Here's an example that works on 2553 and 2231, it displays raw ADC. #include #define DATAPIN BIT6 #define CLOCKPIN BIT5 #define LATCHPIN BIT0 unsigned int txCounter = 0; // Counter variable unsigned char txData = 0; unsigned int digitCounter = 0; // Digit counter unsigned int adcCounter = 0; unsigned const char bcd7digit[10] = { 0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F } ; // BCD to 7 digit map unsigned const char digitSelector[4] = { 0x01, 0x02, 0x04, 0x08 } ; // Digit selector map unsigned char data[4] = {0,0,0,0}; void binaryToUnpackedBCD(unsigned int n, unsigned char * digits); void main(void) { WDTCTL = WDTPW + WDTHOLD; // disable WDT BCSCTL1 = CALBC1_1MHZ; // 1MHz clock DCOCTL = CALDCO_1MHZ; P1OUT |= LATCHPIN; P1DIR |= LATCHPIN + CLOCKPIN + DATAPIN; CCR0 = 2000; TACTL = TASSEL_2 + MC_1; // SMCLK, upmode CCTL0 = CCIE; ADC10CTL1 = INCH_4; ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE; __bis_SR_register(GIE); // enable global while(1) { // main loop txData = digitSelector[digitCounter]; txCounter = 0; while(txCounter < 8) { (txData & BIT7) ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); txData <<= 1; P1OUT |= CLOCKPIN; P1OUT &= ~CLOCKPIN; txCounter++; } txData = bcd7digit[data[digitCounter]]; txCounter = 0; while(txCounter < 8) { (txData & BIT7) ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); txData <<= 1; P1OUT |= CLOCKPIN; P1OUT &= ~CLOCKPIN; txCounter++; } P1OUT &= ~LATCHPIN; // Latch data P1OUT |= LATCHPIN; __bis_SR_register(LPM0_bits); // go to sleep and wait for the timer } } // Timer A0 interrupt service routine #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A (void) { digitCounter++; // Increase digit counter digitCounter &= 0x03; adcCounter++; // Mask, counter range is 0-3 if(adcCounter == 100) { ADC10CTL0 |= ENC + ADC10SC; adcCounter = 0; } __bic_SR_register_on_exit(LPM0_bits); } // ADC10 interrupt service routine #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { binaryToUnpackedBCD(ADC10MEM, data); } void binaryToUnpackedBCD(unsigned int n, unsigned char * digits) { __asm(" clr R14"); __asm(" rla R12"); __asm(" rla R12"); __asm(" rla R12"); __asm(" rla R12"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" rla R12"); __asm(" dadd R14, R14"); __asm(" mov.b R14, 3(R13)"); __asm(" swpb R14"); __asm(" mov.b R14, 1(R13)"); __asm(" rra R14"); __asm(" rra R14"); __asm(" rra R14"); __asm(" rra R14"); __asm(" mov.b R14, 0(R13)"); __asm(" swpb R14"); __asm(" mov.b R14, 2(R13)"); __asm(" and #0x0F0F, 0(R13)"); __asm(" and #0x0F0F, 2(R13)"); return; } Quote Link to post Share on other sites
gwdeveloper 275 Posted September 4, 2011 Share Posted September 4, 2011 One small change to get it going on the 2553: #pragma vector = TIMERA0_VECTOR needs to be: #pragma vector = TIMER0_A0_VECTOR other than that, big thanks!! Quote Link to post Share on other sites
BenjaminoG 0 Posted September 20, 2011 Share Posted September 20, 2011 I think a 250ma regulator is rated for that current - but does not promise to provide current limiting. If this input voltage is low - the available current could be higher as energy consumption is a product of V-Diff. (for linear regs). Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.