biza

Members
  • Content count

    44
  • Joined

  • Last visited

Everything posted by biza

  1. 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)); } }
  2. 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
  3. 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); }
  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. 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
  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. 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
  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. 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
  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. I am looking for a Bluetooth low energy device capable of interconnecting with msp430g2553 can someone suggest me some?
  15. Hello Bluehash, I follow the tutorial, and everything seems to be ok, the file was created earlier on the card. The problem is that does not write on the card, I shared all my file and picture of what happens to me, hoping to get some help, that would allow me to solve the problem.
  16. Friends I need some help,using the petitFAT library, I managed to do the implementation in my application, but I need your help to get write to the memory card thing that I am not able to do. Can anyone help me? config.h diskio.c diskio.h integer.h lcd.c lcd.h main.c main.h pff.c pff.h softserial.c softserial.h spi.c spi.h
  17. Blue Hash, I proceed to some modification to write in SDcard , i will share my code hoping someone can help me. I connect the msp430g2553, with a sdcard and a LCD, he can mount the card and recognize the disk, but do not write in the file.
  18. Hello fellows, I can connect the MSP430G2553, width SDcard Chip, I use a LC studio sdcard and I have made ??all the connections. and ran the program with the Sdcard WRITE.TEXT file saved on the SDcard but nothing happens I have used this connections: SDcard----------------MSP430G2553 GND-------------------GND MISO------------------P1.5 SCK-------------------P1.7 MOSI------------------P1.6 CS---------------------P2.0 3.3V-------------------VCC What i am doing wrong
  19. hello friends, I have a big problem with small MSP430G2553, I would like to make a capture samples at P1.2 of the microcontroller, but my code does not work, what am I doing wrong, can someone help me. My code: unsigned int adcValue = 0; int i, BPM[10]; int maior = BPM[0]; int menor = BPM[0]; int contagem =0; /*****************************************************************/ /********* LOCAL FUNCTIONS *********/ /*****************************************************************/ void ADC_ConfigAnalogInput(void){ P1DIR2IN(BIT0); ADC10CTL0 &= ~(ENC); ADC10CTL1 = (INCH_0 + ADC10DIV_0); ADC10CTL0 = (SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE); ADC10AE0 |= BIT0; ADC10CTL0 |= ENC; } void ADC_ReadAnalogInput(void){ ADC_ConfigAnalogInput(); while (ADC10CTL1 & BUSY); // WAIT IF BUSY ADC10CTL0 |= ADC10SC; __bis_SR_register(CPUOFF + GIE); // LPM0, ADC10_ISR will force exit adcValue = ADC10MEM; } /* * */ unsigned int ADC_GetValue(void) { return adcValue; for (j=0;j<timer; j++){ BPM[j]=adcValue; if(maior < BPM[i]){ maior = BPM[j]; } if(menor > BPM[j]){ menor = BPM[j]; } } if(contagem>59) contagem =0; else contagem++; } /*****************************************************************/ /********* END *********/ /*****************************************************************/
  20. yes there is more code, the main calls the two main functions ADC_GetValue(void),ADC_ReadAnalogInput(void), this lines if(contagem>timer) contagem =0; else contagem++; used to make a count, timer is equal a 59
  21. Hello guys, I'm building a Holter ECG, and would like put one symbol on the LCD. Need to inform the user the level of charge that the battery has. And I would put the battery symbol so that information was given. But I am not getting, someone can give me an example of how I can put a symbol in a particular line of lcd
  22. So you tell me to do the following: In lcd.c void LCD_SetCharacter(unsigned char index, const unsigned char bitmap[8]) { unsigned short iter; lcdWriteCmd(0x38); lcdWriteCmd(0x40 | (index << 3) & 0x3f); for(iter = 0; iter != 8; ++iter) { lcdWriteData(bitmap[iter]); } lcdWriteCmd(0x02); } in lcd.h /*****************************************************************/ /********* CUSTOM *********/ /*****************************************************************/ const unsigned char vazio[] = {0x0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; const unsigned char corazon[]= {0x00,0xa,0x1f,0x1f,0xe,0x4,0x00,0x00}; const unsigned char bat_100[]= {0x4,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f}; const unsigned char bat_75[] = {0x4,0x1b,0x11,0x1f,0x1f,0x1f,0x1f,0x1f}; const unsigned char bat_50[] = {0x4,0x1b,0x11,0x11,0x1f,0x1f,0x1f,0x1f}; const unsigned char bat_25[] = {0x4,0x1b,0x11,0x11,0x11,0x11,0x1f,0x1f}; const unsigned char bat_0[] = {0x4,0x1b,0x11,0x11,0x11,0x11,0x11,0x1f}; /*****************************************************************/ /********* FUNCTION *********/ /*****************************************************************/ void LCD_SetCharacter(); And in main.c ...void main(){LCD_SetCharacter(1, coraz
  23. I have done what you told me, and give me error May I put in lcd.h file: void LCD_SetCharacter(unsigned char index, const unsigned char bitmap[8]); The error is-> #20 identifier "corazon" is undefined
  24. I have some problems with integration of this line of code, where exactly you put this.. LCD_SetCharacter(1,corazon);
  25. I have some problems with integration of this line of code, where exactly you put this.. LCD_SetCharacter(1,corazon);