Jump to content
43oh

Bujhm666

Members
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by Bujhm666

  1. Show also this example: #include <msp430g2553.h> unsigned int adcValues[6] = { 0, 0, 0, 0, 0, 0 }; void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P2DIR |= BIT2; P2OUT &= ~BIT2; ADC10CTL1 = INCH_5 + CONSEQ_1; ADC10CTL0 = ADC10SHT_2 + MSC + ADC10ON + ADC10IE; ADC10DTC1 = 0x06; ADC10AE0 |= 0x3F; CCTL0 = CCIE; // CCR0 interrupt enabled CCR0 = 180; // sample every ~1.5ms TACTL = TASSEL_2 + MC_1 + ID_3; // SMCLK/8, upmode _bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupt } // Timer A0 inte
  2. Thanks. But it is used in the code, regardless of the type of controller: // code duplication, but we are saving clock cycles by not passing dataCommand void writeData(u_char data) { u_char c = 0; LCD_SELECT; #ifdef SPI9BIT LCD_SD_OUT_HI; LCD_CLOCK; #else LCD_DC_HI; #endif while (c < 8) { (data & 0x80) ? (LCD_SD_OUT_HI) : (LCD_SD_OUT_LO); LCD_CLOCK; data <<= 1; c++; } LCD_DESELECT; } // code duplication, but we are saving clock cycles by not passing dataCommand void writeCommand(u_char data) { u_char c =
  3. // pins #define LCD_SCLK_PIN BIT5 // SCK #define LCD_SCLK_PORT P1OUT #define LCD_SD_PIN BIT7 // DIO #define LCD_SD_PORT P1OUT #define LCD_SD_PORT_IN P1IN #define LCD_SD_DIR P1DIR #define LCD_SCE_PIN BIT0 // CS #define LCD_SCE_PORT P1OUT #define LCD_DC_PIN BIT4 // ? - What is this? And do this for PCF8833? #define LCD_DC_PORT P1OUT
  4. The text didn't try to output? Hours for example.
×
×
  • Create New...