• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!

Search the Community

Showing results for tags 'iic'.



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

  • Community Calendar

Found 4 results

  1. Hello I hope you can understand my english I have a texas instruments tm4c123gxl with a SainSmart IIC/I2C/TWI Serial 2004 20x4 LCD Module. I will connect this Display over I²C. For the 5V Supply voltage i have use the VBus on the tm4c... For the SDA/SCL i have use the pin PA6 and PA7. Does it work like this? or need a Logic Level Converter - Bi-Directional for the SDA/SCL Line? from 3,3V to 5V. I have use a Pullup resistor for the Line SDA/SCL, how in the datasheet from the tm4c. And i have use this Code: #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x3F, 20, 4); // set the LCD address to 0x20 for a 16 chars and 2 line display void setup() { lcd.init(); // initialize the lcd // Print a message to the LCD. lcd.backlight(); lcd.print("Hello, world!"); } void loop() { } But my display show nothing only LED backlight.
  2. I have a Spikenzie Labs LCD screen with an interface (screen utilizes the HD44780 chipset). I have it connected to an MSP-EXP432P401R (Rev 1.0). I have finally got code working that allows me to write to the LCD screen through the serial monitor, however I can only write to the screen for a short but varying amount of time. Sometimes I can print to the screen for 5 seconds, sometimes only for 1 second before communication cuts out. Here is the code I am using: #include <Wire.h> #include <LiquidCrystal.h> #define addr 0x40 >> 1 void setup() { Wire.begin(); Serial.begin(9600); } void loop() { Wire.beginTransmission(addr); Wire.write(Serial.read()); Wire.endTransmission(); } My connections are as follows: LCD screen -> MSP432 VCC -> 5V GND -> GND SDA -> pin 10 SCL -> pin 9 I have also tried using a level shifting circuit on the data lines with no effect. Does anyone know what's going on and what I can do to fix this? Thank you
  3. Someone can helpme, i'm taking incorrect readings of a magnetometer I believe with the problem are in my i2c code implementation. /* * Print all printable characters on usb channel using UART mode of USCI module * the print is based in busy wait to transfer characters */ #include "msp/msp430g2553.h" void configureDCO(); void configureUART(); void putc(char); void print (const char[]); void print (short); void printStatus(); main() { configureDCO(); configureUART(); UCB0CTL1 = UCSWRST; //Reset USCI UCB0CTL0 = // USCI_B0 control register UCMST // set master mode | UCMODE_3 // I2C mode select | UCSYNC; // synchronous UCB0CTL1 = // UCSI_B0 control register UCSSEL_2 //select clock source, SMCLK | UCSWRST; UCB0I2CSA = 0x1e; // write desired slave address to the UCBxI2CSA, magnetometer address // prescaler to generate 75 Hz (1MHz of SMCLK / 13981 of prescaler) UCB0BR0 = 0x9D; UCB0BR1 = 0x36; //configure ports P1SEL |= BIT6 | BIT7; P1SEL2|= BIT6 | BIT7; UCB0CTL1 &= ~UCSWRST; // Initializate USCI print("[system] I2C configured\r\n"); // send start to transmit UCB0CTL1 |= UCTR // setting UCTR for transmitter mode | UCTXSTT; // setting UCTXSTT to generate START condition // point to register A ( address 0x00 ) while ( !(IFG2 & UCB0TXIFG) ); // wait UCBxTXIFG are set, when set the buffer are empty UCB0TXBUF = 0x00; // load data to be trasmitted on UCBxTXBUF // write 0x78 in register A, mean of eight measurements, 75 Hz sample rate while ( !(IFG2 & UCB0TXIFG) ); // wait UCBxTXIFG are set, when set the buffer are empty UCB0TXBUF = 0x78; // load data to be trasmitted on UCBxTXBUF // point to register B ( address 0x01 ) while ( !(IFG2 & UCB0TXIFG) ); // wait UCBxTXIFG are set, when set the buffer are empty UCB0TXBUF = 0x01; // load data to be trasmitted on UCBxTXBUF // write 0xa0 in register B, gain five while ( !(IFG2 & UCB0TXIFG) ); // wait UCBxTXIFG are set, when set the buffer are empty UCB0TXBUF = 0xa0; // load data to be trasmitted on UCBxTXBUF // point to mode register ( address 0x02 ) while ( !(IFG2 & UCB0TXIFG) ); // wait UCBxTXIFG are set, when set the buffer are empty UCB0TXBUF = 0x02; // load data to be trasmitted on UCBxTXBUF // write 0x00 in mode register, continuous operation while ( !(IFG2 & UCB0TXIFG) ); // wait UCBxTXIFG are set, when set the buffer are empty UCB0TXBUF = 0x00; // load data to be trasmitted on UCBxTXBUF // send stop UCB0CTL1 |= UCTXSTP; // send stop while (UCB0CTL1 & UCTXSTP); // wait STOP condition is ack __delay_cycles(6000); // wait 6ms, until change the settings of magnetometer // send start to receive UCB0CTL1 &= ~UCTR; // setting UCTR for receiver mode UCB0CTL1 |= UCTXSTT; // setting UCTXSTT to generate START condition while (UCB0CTL1 & UCTXSTT); // infinit loop, show continually the measuread values while (true) { // allocate space to the measured values, (x,y,z) coordinates, high byte (h prefix), low byte (l prefix) char hx, lx, hz, lz, hy, ly; // receive data output X MSB register while (!(IFG2 & UCB0RXIFG) ); // wait UCBxRXIFG are set, when set read buffer are full hx = UCB0RXBUF; // load data from buffer to local memory // receive data output X LSB register while (!(IFG2 & UCB0RXIFG) ); // wait UCBxRXIFG are set, when set read buffer are full lx = UCB0RXBUF; // load data from buffer to local memory // receive data output Z MSB register while (!(IFG2 & UCB0RXIFG) ); // wait UCBxRXIFG are set, when set read buffer are full hz = UCB0RXBUF; // load data from buffer to local memory // receive data output Z LSB register while (!(IFG2 & UCB0RXIFG) ); // wait UCBxRXIFG are set, when set read buffer are full lz = UCB0RXBUF; // load data from buffer to local memory // receive data output Y MSB register while (!(IFG2 & UCB0RXIFG) ); // wait UCBxRXIFG are set, when set read buffer are full hy = UCB0RXBUF; // load data from buffer to local memory // receive data output Y LSB register while (!(IFG2 & UCB0RXIFG) ); // wait UCBxRXIFG are set, when set read buffer are full ly = UCB0RXBUF; // load data from buffer to local memory // compose (x, y, z) values short x, y, z; x = (static_cast<short>(hx) << 8) | lx; // compose x MSB and LSB z = (static_cast<short>(hz) << 8) | lz; // compose z MSB and LSB y = (static_cast<short>(hy) << 8) | ly; // compose y MSB and LSB //print (x, y, z) measured values print("( "); print(x); print(", "); print(y); print(", "); print(z); print(" )"); print("\r\n"); } } void configureDCO() { WDTCTL = WDTPW + WDTHOLD; // Stop WDT // Set DCO to 1MHz BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; __delay_cycles(1000000); } void configureUART() { UCA0CTL1 |= UCSWRST; // put USCI in reset mode // P1.1 = RXD, P1.2=TXD P1SEL |= BIT1 | BIT2; P1SEL2 |= BIT1 | BIT2; UCA0CTL1 |= UCSSEL_3; // Use SMCLK // Set baud rate to 9600 with 1MHz clock (Data Sheet 15.3.13) 1MHz / 104 UCA0BR0 = 104; UCA0BR1 = 0; UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1, correction for the fractional part ( the rest, 9600 - 1MHz / 104) UCA0CTL1 &= ~UCSWRST; // put USCI in operad mode (removing reset mode) /*End configuration hardware UART */ print("[system] uart configured\r\n"); }; void putc(char ch) { while(!(IFG2 & UCA0TXIFG)); UCA0TXBUF = ch; } void print (const char msg[]) { for (int i = 0; msg[i] != '\0'; ++i) putc(msg[i]); } void print (short value) { if (value == 0) { putc('0'); return; } if (value < 0) { putc('-'); value *= -1; } unsigned int size; char buffer[20]; for (size = 0; value; ++size, value /= 10) buffer[size] = value % 10; while (size) putc(buffer[--size] + '0'); } void printStatus() { print("Status:\n\r"); #define __PRINT_STATUS(X, MSG) if (UCB0STAT & X) print(#MSG "! "); __PRINT_STATUS(UCNACKIFG, nack); __PRINT_STATUS(UCALIFG, arbitration lost); __PRINT_STATUS(UCGC, receive general call); __PRINT_STATUS(UCBBUSY, bus busy); __PRINT_STATUS(UCSCLLOW, SCL low); __PRINT_STATUS(UCSTPIFG, stop received); __PRINT_STATUS(UCSTTIFG, start received); print("done\n\r"); } Please this is a old problem, someone can helpme? David Kennedy S. Araujo Computer Engineering Student (PUC GO)
  4. MSP430F5529 has two I2C interfaces, using P3.0/P3.1 (SDA/SCL) and P4.2/P4.1 (SCL/SDA) and two SPI interfaces using P3.0/P3.1/P3.2/P2.7 (MOSI/MISO/SCK/CS) and P4.2/P4.1/P4.3/P4.0 (MISO/MOSI/SCK/CS). How, or rather maybe, what is the best way to access the non-default I2C/SPI peripherals, without resorting to modifying the Energia core? For instance, I am using the LiquidCrystal_I2C library found here, and it works fine on the G2553 and F5529, but I'd like to move the LCD over to the other I2C peripheral so I can use those pins for an SPI device. On Tiva, one can do "Wire.setModule(1)" or similar to do something with an alternative peripheral, but it seems this isn't possible with the F5529. Might also be worth noting the above mentioned library doesn't play well on the LM4F/TM4C LaunchPads either. And FWIW, the LCD I'm using is a 20x4 with an I2C interface board labeled "Arduino-IIC-LCD GY-LCD-V1"