• 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!

biza

Members
  • Content count

    45
  • Joined

  • Last visited

About biza

  • Rank
    Advanced Member

Recent Profile Visitors

82 profile views
  1. Hello fellows, I need some help, with a situation, I want convert some analog signals to digital and send him by the UART communication, but I dont get how to solve this problem. my digital values is represented by "tempADC" variable, soo how can I get a buffer with values to the pc with UART communication. I try many things, but i dont understand how to put my output signal in the terminal in this format. temperature: 40º temperature: 41º temperature: 42º temperature: 43º can anyone help me?! my code: #include "uart_Tx.h" #include "stdio.h" void UART_TxConfig(void){ /*CLOCK SYSTEM SUPORT (CS)*/ CS->KEY = 0x695A;/*UNLOCK ALL 16 LSB CS REGISTERS*/ CS->CTL0 = 0;/*RESET PARAMETERS*/ CS->CTL0 = CS_CTL0_DCORSEL_5;/**/ /*CLOCK SYSTEM*/ /*SELA_2 ACLK = REFOCLK*/ /*SELS_3 SMCLK = DCOCLK*/ /*SELM_3 MCLK = DCOCLK*/ CS->CTL1 = CS_CTL1_SELA_2 | CS_CTL1_SELS_3 | CS_CTL1_SELM_3; /*LOCK ACESSES TO REGISTERS*/ CS->KEY = 0;/*UNLOCK ALL 16 LSB CS REGISTERS*/ /*UART PIN CONFIGURATION*/ P1-> SEL0 |= BIT2 | BIT3; /*SET 2 UART PIN's*/ /*ACTIVE INTERRUPTION's*/ __enable_interrupt(); /*ACTIVE eUSCIA0 INTERRUPT IN NVIC MODULE*/ NVIC->ISER[0] = 1 << ((EUSCIA0_IRQn) & 31); /*CONFIGURE UART*/ UCA0CTLW0 |= UCSWRST; UCA0CTLW0 |= UCSSEL__SMCLK;/*SELECT SMCLK CLOCK SOURCE*/ /*BAUD RATE CALCULATION * BAUD RATE DIVISOR (TRANSMITIONS RATE) * 12MHz/(16*9600) = 78.125 VELOCITY *FRACTIONAL PORTION = 0.125 *FRACTIONAL */ UCA0BR0 = 26; /*48000000/16/115200*/ UCA0BR1 = 0x00; UCA0MCTLW = 0x1000 | UCOS16 | 0x0020; /*CONTROL WORD REGISTER*/ UCA0CTLW0 &= ~UCSWRST; /*SOFTWARE RESET DISABLE*/ UCA0IE |=UCRXIE; while(1){ } } /*UART INTERRUPT SERVICE ROUTINE*/ void EUSCIA0_IRQHandler (void){ if (UCA0IFG & UCRXIFG){ while(!(UCA0IFG & UCTXIFG)); UCA0TXBUF = UCA0RXBUF; //UCA0TXBUF = adcTemp; //P1->OUT ^= BIT0; } }
  2. Hello I have some problems with a UART comunication to pc, I use CCS to program my code and to debug the results I use Terminal. So my code works fine and do everything well, the biggest problem is the features dont appear well in Terminal window. Can anyone help me?I Send my code and image to apreciate #include "msp.h" int main(void){ UART_TxConfig(); } void UART_TxConfig(void){ /*CLOCK SYSTEM SUPORT (CS)*/ CS->KEY = 0x695A;/*UNLOCK ALL 16 LSB CS REGISTERS*/ CS->CTL0 = 0;/*RESET PARAMETERS*/ CS->CTL0 = CS_CTL0_DCORSEL_5;/**/ /*CLOCK SYSTEM*/ /*SELA_2 ACLK = REFOCLK*/ /*SELS_3 SMCLK = DCOCLK*/ /*SELM_3 MCLK = DCOCLK*/ CS->CTL1 = CS_CTL1_SELA_2 | CS_CTL1_SELS_3 | CS_CTL1_SELM_3; /*LOCK ACESSES TO REGISTERS*/ CS->KEY = 0;/*UNLOCK ALL 16 LSB CS REGISTERS*/ /*UART PIN CONFIGURATION*/ P1-> SEL0 |= BIT2 | BIT3; /*SET 2 UART PIN's*/ /*ACTIVE INTERRUPTION's*/ __enable_interrupt(); /*ACTIVE eUSCIA0 INTERRUPT IN NVIC MODULE*/ NVIC->ISER[0] = 1 << ((EUSCIA0_IRQn) & 31); /*CONFIGURE UART*/ UCA0CTLW0 |= UCSWRST; UCA0CTLW0 |= UCSSEL__SMCLK;/*SELECT SMCLK CLOCK SOURCE*/ /*BAUD RATE CALCULATION * 12MHz/(16*9600) =78.125 *FRACTIONAL PORTION = 0.125 *FRACTIONAL */ UCA0BR0 = 26;/*48000000/16/115200*/ UCA0BR1 = 0x00; UCA0MCTLW = 0x1000 | UCOS16 | 0x0020; /*CONTROL WORD REGISTER*/ UCA0CTLW0 &= ~UCSWRST; /*SOFTWARE RESET DISABLE*/ UCA0IE |=UCRXIE; while(1){ UCA0TXBUF = 'A'; UCA0TXBUF = 'B'; UCA0TXBUF = 'C'; UCA0TXBUF = 'D'; UCA0TXBUF = 0x61; } } /*UART INTERRUPT SERVICE ROUTINE*/ void EUSCIA0_IRQHandler (void){ if (UCA0IFG & UCRXIFG){ while(!(UCA0IFG&UCTXIFG)); } }
  3. Enl, thank you for your answer So I understand your explanation, but how can I proced to read temperature with that sensor. Since I dont obtain a consistent temperature I remove the pin P5.4 from MSP432 and measure the output pin voltage, where I see a float voltage between 1.10 to 1.15 volts. Thank's in advance
  4. No, I don't have another device. But forget the LM35 sensor, you configure the P5.4 to receive a analog signal and convert him, why this pin have oscillation voltage, I have used a multimeter and I measure this pin and I get between 1.10 and 1.15V.
  5. Thank you Nurse Bob, for answer my question, I have 5V power supply to LM35. but my problem has in P5.4 without connect to the output pin of LM35, in the multimeter I measure 1.10 to 1.15V , why? All that calcules are in LM35 data sheet.
  6. Fellows, I'am trying to adquire a signal with ADC converter in the MSP432, but some problems appeard. I try to read lm35 sensor temperature and before conect the lm35 output signal to input pin of MSP432, i made a mesurement with multimeter and i see the pin has 1.10 +/- 1.15v. It's this normal? The code was made in ccs, and with classic programation (registers), this is the code: #include "adc.h" #include "lcd.h" #include "stdio.h" extern char Mensaje[]; /**/ void adc(void){ volatile unsigned int i; /*ADC CONFIGURATION*/ P5->SEL1 |= BIT4; P5->SEL0 |= BIT4; /*ENABLE GLOBAL INTERRUPTS*/ __enable_irq(); /*ENABLE ADC INTERRUPT IN NVIC MODULE*/ NVIC->ISER[0] = 1 << ((ADC14_IRQn) & 31); /*Sampling time, S&H=16, ADC14 on*/ ADC14->CTL0 = ADC14_CTL0_SHT0_2 | ADC14_CTL0_SHP | ADC14_CTL0_ON; ADC14->CTL1 = ADC14_CTL1_RES_2; ADC14->MCTL[0] |= ADC14_MCTLN_INCH_1; ADC14->IER0 |= ADC14_IER0_IE0; SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; while (1) { for (i = 20000; i > 0; i--); // Start sampling/conversion ADC14->CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC; __sleep(); __no_operation(); } } void ADC14_IRQHandler(void) { int value_adc=ADC14->MEM[0]; float value_vol= value_adc * (3.3/4096); //sprintf(Mensaje,"%d",value_adc); sprintf(Mensaje,"%1.2f",value_vol); LCD_SetText(Mensaje,5 ,0); }
  7. Dear friends, I've already made changes in all files, and I can not get the lcd to work. Attached let the new codes, thank you who can help me! lcd.c lcd.h main.c main.h
  8. Hello fellows, I made a code to interact the MSP430, with the LCD, but now I would like to have it interact with the MSP432. And I'm having some problems because I want to use specific pins, can anyone help me change the code? My difficulty is: the MSP430 I use PORT P1 and P2, the problem is in the MSP432 I need PORT P2, P5 and P6 This is my connections LCD->MSP432: EN -> (P2 + BIT3) RS -> (P6 + BIT7) D4 -> (P2 + BIT6) D5 -> (P2 + BIT4) D6 -> (P5 + BIT6) D7 ->(P6 + BIT6) lcd.c lcd.h main.c main.h
  9. Roadrunner84, I already take the decision and made this code: #include "lcd.h" /*****************************************************************/ /********* DEFINE *********/ /*****************************************************************/ #define P2orP5orP6LCD 0x0200/*PORT[A] OU PORT[B] OU PORT[C]*/ #define EN (PP2 + BIT3) #define RS (PP6 + BIT7) #define D4 (PP2 + BIT6) #define D5 (PP2 + BIT4) #define D6 (PP5 + BIT6) #define D7 (PP6 + BIT6) /*COMMANDS*/ #define CLEAR 0x01 /*****************************************************************/ /********* LOCAL FUNCTIONS *********/ /*****************************************************************/ void lcdDirPinout(unsigned int pin) { if(pin < P2orP5orP6LCD){ P2DIR |= (pin & 0x00FF); }else { P5DIR |= (pin & 0x00FF); } } void lcdClrPinout(unsigned int pin) { if(pin < P2orP5orP6LCD){ P2OUT &= ~(pin & 0x00FF); }else{ P5OUT &= ~(pin & 0x00FF); } } void lcdSetValue(unsigned char value) { if(value & ){ lcdDirPinout(D7); }else{ lcdClrPinout(D7); } if(value & ){ lcdDirPinout(D6); }else{ lcdClrPinout(D6); } if(value & ){ lcdDirPinout(D5); }else{ lcdClrPinout(D5); } if(value & ){ lcdDirPinout(D4); }else{ lcdClrPinout(D4); } delay_us(5); } void lcdTriggerEN() { lcdSetPinout(EN); delay_us(40); lcdClrPinout(EN); } void lcdWriteData(unsigned char data) { lcdSetPinout(RS); lcdSetValue(data >>); /*UPPER NIBBLE*/ lcdTriggerEN(); lcdSetValue(data); /*LOWER NIBBLE*/ lcdTriggerEN(); delay_us(40); } void lcdWriteCmd(unsigned char cmd) { lcdSetPinout(RS); lcdSetValue(cmd >>); /*UPPER NIBBLE*/ lcdTriggerEN(); lcdSetValue(cmd); /*LOWER NIBBLE*/ lcdTriggerEN(); delay_ms(2); } /*****************************************************************/ /********* GLOBAL FUNCTIONS *********/ /*****************************************************************/ void LCD_PortConfig(void) { lcdDirPinout(D7); lcdDirPinout(D6); lcdDirPinout(D5); lcdDirPinout(D4); lcdDirPinout(EN); lcdDirPinout(RS); } void LCD_Initialize(void) { delay_us(80); P6OUT = ; lcdTriggerEN(); delay_ms(2); lcdTriggerEN(); delay_ms(2); lcdTriggerEN(); delay_ms(2); P6OUT = ; /*SWITCH TO 4-BIT MODE*/ lcdTriggerEN(); delay_ms(2); lcdWriteCmd(0x28);/*4 BIT'S MODE, 2 LINES, WITH MATIX 5x8*/ lcdWriteCmd(0x08);/*DISPLAY CURSOR OFF, SHOW OFF WITHOUT CLEAR DDRAM*/ lcdWriteCmd(0x01);/*CLEAR ALL CONTENT SCREEN AN DDRAM*/ lcdWriteCmd(0x06);/*SEND DE PLACE TO PUT CHARACTER HIM*/ lcdWriteCmd(0x0C);/*SHOW CURSOR OFF AND DISPLAY ON, WITHOUT BLINK*/ } void LCD_SetText(char* text, int x, int y) { unsigned int i; if(x < 16){ x|= 0x80; /*WRITE THE FIRST LINE ON LCD*/ switch(y){ case 1: x|= 0x40; /*WRITE THE SECOND LINE ON LCD*/ break; case 2: x|=; /*FIRST LINE WRITE REVERSE*/ break; case 3: x|=; /*SECOND LINE WRITE REVERSE*/ break; } lcdWriteCmd(x); } i=0; while(text[i]!='\0'){ lcdWriteData(text[i]); i++; } } void LCD_SetInt(int val, int x, int y){ char number_string[16]; sprintf(number_string,'%d', val); /*CHARACTER INTEGER TO STRING CONVERTION*/ LCD_SetText(number_string, x, y); } void LCD_Clear() { lcdWriteCmd(CLEAR); } void LCD_SetSymbol(unsigned char symbol, unsigned char offset, unsigned char line) { lcdWriteCmd(line+offset); lcdWriteData(symbol); } /*****************************************************************/ /********* END *********/ /*****************************************************************/ But how can i detect the port? I need to detect the register of the following ports P2 P5 P6
  10. I'm trying to connect the msp432com an lcd. so This way I have to create a routine to read one char variable like0x0A for example and write the data pins for the LCD .(lcd 16x2 4bit interface). Just for testing the port pins registers.
  11. Fellows, I have a big problem with a application i have trying to do. I need to read a characters who came in byte format and transform him in bit format I have some trouble in write the function, can anyone helpe me
  12. can help me? Biza, Sent from my iPad using Tapatalk
  13. So I am trying to make a ambulatory ecg, and I need reduce the sample rate from 200ksps to 100 or 200 sps (100 or 200Hz). So i need register some data acquisition provided from heart each second Biza, Sent from my iPad using Tapatalk
  14. Fellow s I need some help, with my msp430g2553.I want decrease the sample rate can anyone help me Biza, Sent from my iPad using Tapatalk
  15. I am looking for a Bluetooth low energy device capable of interconnecting with msp430g2553 can someone suggest me some?