Jump to content

Oves

Members
  • Content Count

    3
  • Joined

  • Last visited

About Oves

  • Rank
    Noob Class

Profile Information

  • Location
    Kiev/Ukraine
  1. Oves

    msp430g2452: how to send 16 bit at once?

    Thanks a lot. It works great!
  2. Hi, I have working code for msp430g2452 which sends data via spi as 8 bit at once. Could somebody, please, say how to change this code to send the data as 16 bit at once? Thanks a lot in advance. #include <msp430.h> // #define PIN_SCLK BIT5 //1.5 #define PIN_DATA BIT6 //1.6 #define PIN_CS1 BIT4 //1.4 #define PIN_CS2 BIT0 //1.0 #define PIN_RED BIT0 //1.0 #define SELECT(PIN) P1OUT &= ~PIN #define DESELECT(PIN) P1OUT |= PIN // #define M_DECODEMODE 0x09 #define M_INTENSITY 0x0A #define M_SCANLIMIT 0x0B #define M_SHUTDOWN 0x0C #define M_DISPLAYTEST 0x0F void matrixSet(const unsigned char address, const unsigned char value) { SELECT(PIN_CS1); //// USISRL = address; USICNT = 8; // wait for an USICNT to decrement to 0 while (!(USICTL1 & USIIFG)); //// USISRL = value; USICNT = 8; // wait for an USICNT to decrement to 0 while (!(USICTL1 & USIIFG)); DESELECT(PIN_CS1); } void matrixInit(){ matrixSet(M_DECODEMODE, 0x00); // BCD mode for digit decoding matrixSet(M_INTENSITY, 0x05); // Segment intensity matrixSet(M_SCANLIMIT, 0x07); // Display scan limit matrixSet(M_SHUTDOWN, 0x01); // Turn on the display matrixSet(M_DISPLAYTEST,0x00); // No test } void matrixClear() { unsigned char x; for(x=1; x<9; x++) matrixSet(x, 0x00); } void matrixTest(){ unsigned char x; for(x=1; x<9; x++) matrixSet(x, 1 << (x-1) | 1 << (7-x) ); } void main(void) { WDTCTL = WDTPW + WDTHOLD; // disable WDT BCSCTL1 = CALBC1_16MHZ; // 16MHz clock DCOCTL = CALDCO_16MHZ; P1DIR |= PIN_CS1+ PIN_CS2 + PIN_DATA + PIN_SCLK; DESELECT(PIN_CS1); //// setup SPI USICTL0 |= USISWRST; // put USI in reset mode, source USI clock from SMCLK USICTL0 |= USIPE5 | USIPE6 | USIPE7 | USIMST | USIOE; USICKCTL |= USIDIV_0 | USISSEL_2; // default speed 16MHz/1 USICTL1 = USICKPH; // SPI_MODE_0, CPHA=0 USICKCTL &= ~USICKPL; // CPOL=0 USICTL0 &= ~USILSB; // MSBFIRST USICTL0 &= ~USISWRST; // release for operation //// //// matrixInit(); matrixClear(); matrixTest(); }
  3. Hi, Is it possible to change RF frequency of the Chronos from 868mhz to 915mhz? If it is possible, could you, please, say how? Thanks a lot,
×