Jump to content
Forum sending old emails Read more... ×

Search the Community

Showing results for tags 'digipot'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 1 result

  1. Hello there, I'm trying to program the digipot using spi communication to set the ISL23428 digipots to thier maximum values. I used the multimeter to inspect the output voltage for each digipots and the result is zero for both. I'm not sure if the issue is in my code or with the digipots. Thanks in advance for your help. #include <msp430fr5989.h> #include <stdint.h> #define delay(x) __delay_cycles(x * 8000UL) void digitalPotWrite(); uint8_t SPI_transfer(uint8_t _data); uint8_t spi_send(const uint8_t _data); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer PM5CTL0 &= ~LOCKLPM5; // setup UCB1 UCB1CTLW0 = UCSWRST | UCSSEL_2; // UCSWRST= Put USCI in reset mode, UCSSEL_2 = source USCI clock from SMCLK UCB1CTLW0 |= UCCKPH | UCMSB | UCMST | UCSYNC; //UCCKPH = SPI MODE 0(CPOL=0 CPHA=0) , UCMSB= MSB, UCMST= master mode P3SEL0 |= BIT1; // P3.1-> UCB1SIMO P3SEL1 &= ~ BIT1; P3SEL0 |= BIT2 ; //P3.2-> UCB1SOMI P3SEL1 &= ~ BIT2 ; P3SEL0 |= BIT0 ; //P3.0-> USCB1CLK P3SEL1 &= ~ BIT0 ; P1OUT |= BIT0; P1DIR |= BIT0; // set cs P1.0 as output // UCB1 set initial speed UCB1BR0 |= 0x02; UCB1BR1 = 0; UCB1CTLW0 &= ~UCSWRST; // release UCB1 for operation delay(10); digitalPotWrite(); UCB1CTLW0 = UCSWRST; //spi disable for(;;) { } } void digitalPotWrite() { // take the CS pin low to select the chip: P1OUT &= ~BIT0; delay(10); // send writing instruction to WR0 SPI_transfer(0b11000000); // 110 is writing instruction followed by WR0 address(00000) delay(10); SPI_transfer(0b11111111); // set WR0 to max value delay(10); // send writing instruction to WR1 SPI_transfer(0b11000001); // 110 is writing instruction followed by WR1 address(00001) delay(10); SPI_transfer(0b11111111); // set WR1 to max value delay(10); // take the CS pin high to de-select the chip: P1OUT |= BIT0; } uint8_t SPI_transfer(uint8_t _data) { return spi_send(_data); } uint8_t spi_send(const uint8_t _data) { /* Wait for previous tx to complete. */ while (!(UCB1IFG & UCTXIFG)) // UCB1 flage ; /* Setting TXBUF clears the TXIFG flag. */ UCB1TXBUF = _data; // transfer buffer for UCB1 /* Wait for a rx character? */ while (!(UCB1IFG & UCRXIFG)) // UCB1 flage ; /* Reading clears RXIFG flag. */ return UCB1RXBUF; //reciveing buffer for UCB1 }
×