Jump to content

biza

Members
  • Content count

    59
  • Joined

  • Last visited

About biza

  • Rank
    Level 1

Recent Profile Visitors

401 profile views
  1. MSP432 RTC User adjust

    now I have done some alterations on my file clock.c, and i see in the register's the clock working, so how can I get each parameter (Year, Month, Day, Hour, Minute)
  2. MSP432 RTC User adjust

    can anyone some help me? I have some problems with user rtc configuration in msp432 I made a firmware where the user choose by hardware configuration adjust date and time (alarm clock). The problem is ... after the user adjust date and time I would like use the rtc to control the watch and show the current date and time in a lcd. The problem is ... after the user adjust date and time I would like use the rtc to control the watch and show the current date and time in a lcd. Soo i need some help in two things pass the user value (decimal) to hexadecimal or BCD and the inverse get the hexadecimal or BCD value to decimal to show in LCD . I'am using CCS, in CMSIS on attach i leave the code I have made to test it!
  3. MSP432 RTC User adjust

    can anyone some help me? I have some problems with user rtc configuration in msp432 I made a firmware where the user choose by hardware configuration adjust date and time (alarm clock). The problem is ... after the user adjust date and time I would like use the rtc to control the watch and show the current date and time in a lcd. The problem is ... after the user adjust date and time I would like use the rtc to control the watch and show the current date and time in a lcd. Soo i need some help in two things pass the user value (decimal) to hexadecimal or BCD and the inverse get the hexadecimal or BCD value to decimal to show in LCD . I'am using CCS, in CMSIS on attach i leave the code I have made to test it! test.zip
  4. Hello fellows, I 'am trying develop a system with msp432 and sensor tmp006 , i made a sample code where i configure de I2C protocol but i don't get the temperature of the sensor. did anyone can help me? I am use the CCS with CMSIS, any help is welcome. thanks in advance! #define SCL_Pin BIT5 /*PIN 5*/ #define SDA_Pin BIT4 /*PIN 4*/ #define TMP006_ADDR (0x40) /*DEVICE ADRESS*/ uint8_t RXData[5] = {0}; uint8_t RXDataPointer; void TMP006_Initialize(void){ /*I2C PINS CONFIGURATION*/ P6->SEL0 |= SCL_Pin | SDA_Pin; /*PIN P6.5 AND P6.4 FOR I2C*/ /*INITIALIZE DATA VARIABLE*/ RXDataPointer = 0; __enable_irq(); NVIC->ISER[0] = 1 << ((EUSCIB1_IRQn) & 31); /*ENABLE EUSCIB1 INTERRUPT IN NVIC MODULE*/ /*CONFIGURE*/ EUSCI_B1->CTLW0 |= EUSCI_N_CTLW0_SWRST; /*SOFTWARE RESET ENABLE*/ EUSCI_B1->CTLW0 |= EUSCI_B_CTLW0_SWRST | /*REMAINS EUSCI IN RESET MODE*/ EUSCI_B_CTLW0_MODE_3 | /*I2C MODE*/ EUSCI_B_CTLW0_MST | /*MASTER MODE*/ EUSCI_B_CTLW0_SYNC | /*SYNC MODE*/ EUSCI_B_CTLW0_SSEL__SMCLK; /*SMCLK CLOCK SOURCE*/ EUSCI_B1->CTLW1 |= EUSCI_B_CTLW1_ASTP_2; /*AUTOMATIC STOP*/ EUSCI_B1->BRW = 30; /*BAUDRATE = SMCLK/30 =>12 000 000/30= 400 000 Hz*/ EUSCI_B1->TBCNT = 0x0005; /*NUMBER OF BYTES TO BE RECEIVED*/ EUSCI_B1->I2CSA = TMP006_ADDR; /*SLAVE I2C SPECIFIC ADRESS*/ EUSCI_B1->CTLW0 &= ~(EUSCI_B_CTLW0_SWRST); /*RELESE eUSCI FROM RESET*/ EUSCI_B1->IE |= EUSCI_B_IE_RXIE | /*ENABLE RECEIVE INTERRUPT*/ EUSCI_B_IE_NACKIE| /*ENABLE NACK INTERRUPT*/ EUSCI_B_IE_BCNTIE; /*ENABLE BYTE COUNTER INTERRUPT*/ } void UartI2C_Task(void){ unsigned int i; SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk; /*DONT WAKE UP PON EXIT ISR*/ for(i = 2000;i>0;i--); /*VERIFY IF STOP CONDITION WAS SENT*/ if(EUSCI_B1->CTLW0 & EUSCI_B_CTLW0_TXSTP); EUSCI_B1->CTLW0 |= EUSCI_B_CTLW0_TXSTT; /*I2C START CONDITION*/ __sleep(); __no_operation(); } /*I2C INTERRUPT SERVICE ROUTINE*/ void EUSCIB0_IRQHandler(void) { if (EUSCI_B0->IFG & EUSCI_B_IFG_NACKIFG){ EUSCI_B0->IFG &= ~ EUSCI_B_IFG_NACKIFG; EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_TXSTT; /*I2C START CONDITION*/ } if (EUSCI_B0->IFG & EUSCI_B_IFG_RXIFG0){ EUSCI_B0->IFG &= ~ EUSCI_B_IFG_RXIFG0; RXData[RXDataPointer++] = EUSCI_B0->RXBUF;/*GET TX DATA*/ if (RXDataPointer > sizeof(RXData)){ RXDataPointer = 0; } // Wake up on exit from ISR SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; /*WAKE UP ON EXIT DROM ISR*/ } if (EUSCI_B0->IFG & EUSCI_B_IFG_BCNTIFG){ EUSCI_B0->IFG &= ~ EUSCI_B_IFG_BCNTIFG; } }
  5. Help with some registers

    Hello Rei Vilo, it was not my intention to post more than once, something wrong happened, to post the post several times
  6. Help with some registers

    Hello Fellow, I need some help with a code excerpt, i can't convert this following code of MSP430F5529, into a code of MSP432. someone can help me? void Set_DMA_SPI(void) { DMACTL0 = DMA0TSEL_12; // USCI_B0 Transmit Ready Trigger //DMA0SA = (void (*)())&UCB0RXBUF; // Source block address //DMA0DA = (void (*)())ADC_Read_data; // Destination single address DMA0SZ = 16; // Block size DMA0CTL = DMADT_4 + DMADSTINCR_3 + DMADSTBYTE + DMASRCBYTE; // Rpt, inc src, byte-byte DMA0CTL |= DMAEN; // Enable DMA for consecutive Xfers }
  7. SD card data logging

    what kind of mcu are you using, can you show some code to help you?
  8. Hello Friends, Now I facing some problems with getting correct readings of ADC ports in MSP432. I Am using a multimeter to get the viability of the correct process. I am using CCS 7.0 and CMSIS mode writing code. My question... it's normal the measurements not be stable? I am using P5.5 pin port (A0) and this pin have different values of voltage, or any time change the value. It' is normal? I leave my code for get the readings for the ADC. #include "msp.h" /*DEFINE VAR LIKE A INTEGER*/ volatile int value_adc; void ADC_Initialize(void){ /*CONFIGURE LED OUTPUT*/ P1->OUT &= ~BIT0; /*CLEAR LEAD OUTPUT */ P1->DIR |= BIT0; /*SET DIRECTION OUTPUT*/ /*ADC CONFIGURATION*/ P5->SEL1 &= ~BIT5; /*CONFIGURE P5.5 (A0) FOR ADC*/ P5->SEL0 |= BIT5; /*ENABLE GLOBAL INTERRUPTS*/ __enable_irq(); NVIC->ISER[0] = 1 << ((ADC14_IRQn) & 31); /*ENABLE ADC INTERRUPT IN NVIC MODULE*/ ADC14->CTL0 &= ~ADC14_CTL0_ENC; /*CONFIGURE ADC14*/ ADC14->CTL0 = ADC14_CTL0_SHT0_2 | ADC14_CTL0_SHP | ADC14_CTL0_ON; /*ADC14 ON | S&H=16 | SAMPLING TIME*/ ADC14->CTL1 = ADC14_CTL1_RES_3; /*USE SAMPLE TIME, 14 BIT'S CONVERSION RESULTS*/ ADC14->MCTL[0] |= ADC14_MCTLN_INCH_0; /*A0 ADC INPUT SELECT Vref=AVCC*/ ADC14->IER0 |= ADC14_IER0_IE0; /*ENABLE ADC CONVERT COMPLETE INTERRUPT*/ SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; } void ADC_Task(void){ volatile unsigned int i; //P1->OUT ^= BIT0; for (i = 200000; i > 0; i--); /*DELAY CYCLE*/ ADC14->CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC; /*ENABLE CONVERTION | SAMPLING CONVERSION*/ __sleep(); __no_operation(); } void ADC14_IRQHandler(void) { // if(ADC14->MEM[0] >= 0x7FF){ /*CONVERT DE SIGN OF CONVERTION IN A VARIABLE*/ value_adc = ADC14->MEM[0]; LCD_SetInt(value_adc,12 ,0); printf(value_adc); /*VERIFY IF THE INPUT PINS IS SET TO*/ //while(ADC14->CTL0 & ADC14_CTL0_BUSY); /*VOLTAGE CALCULATIONS*/ //value_vol = (value_adc * Vref_1)/digitalValue_1; // sprintf(adcData,"%2.2f",value_vol); // LCD_SetText(adcData,6 ,0); // temp = value_vol/gradeTemp; // sprintf(TEMP_C,"%2.2f",temp); // LCD_SetText(TEMP_C,0 ,0); //LCD_SetText(TEMP_C,0 ,0); /*CURRENT*/ // UART_Task(adcData,TEMP_C); /* if(value_adc > newValue_Adc){ P1->OUT |= BIT0; }else{ P1->OUT &= ~BIT0; }*/ //}else{ // LCD_SetText("ERROR",6 ,0); //} }
  9. Hello NurseBob, Sorry for the delay, but I've been sick. I send you the data of the connections, for LCD and SDcard, PORT | PIN conections. MSP432------------------>LCD MSP432------------------>SDcard J4 J1 P2.6----------------------->D4 P1.5------------------>CLK P2.4----------------------->D5 P4.6------------------>CS/SS P5.6----------------------->D6 J2 P6.6----------------------->D7 P1.6------------------>MOSI P2.3----------------------->E P1.7------------------>MISO P6.7----------------------->RS The SDcard board:
  10. Hello NurseBob, sorry, i forgot to say what dispositive who am using, yes is the MSP432. But I not using the booster pack, its a simple arduino shield to SDcard, i really do a schema to share with you. This code have a LCD conection too.
  11. Hello people, I'am trying use a SDCARD only to regist data. All my project was made with "MSPClassic Registers", so I saw in the forum a Bluehash post, but was in CMSIS, in mode to satisfy my project I try to change some files. Now I have some problems to finish him there is someone who can help me?I need Something very simple, just confirm if the card is loaded or not and save data Conections: * P4.6 - CS (active low) * P1.6 - MOSI UCB0SIMO * P1.5 - CLK UCB0CLK * P1.7 - MISO UCB0SOMI FILES: spi.c lcd.c lcd.h main.c main.h pff.c pff.h config.h diskio.c diskio.h integer.h spi.h
  12. How to send converted values by UART to PC

    Thank you Nurse bob, I' solved this problem, but thanks for your help.
  13. 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; } }
  14. 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)); } }
  15. 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
×