Jump to content

leetrieu

Members
  • Content Count

    13
  • Joined

  • Last visited

About leetrieu

  • Rank
    Member
  • Birthday 12/06/1991

Contact Methods

  • Website URL
    http://lethanhtrieu.tk

Profile Information

  • Gender
    Not Telling
  • Location
    Viet Nam
  • Sparkfun
    Try your best ! Let me see!
  • Github
    http://www.payitforward.edu.vn/forum/forum/

Recent Profile Visitors

216 profile views
  1. leetrieu

    [Help] RTC BQ32000

    Hello everybody !! I tried to calibrtion 1Hz on RTC BQ32000 of TI. The calibration process is described below. This calibration process does not works and I would like to know the way in which it should be done correctly. The steps taken during the calibration procedure were the following: 1. Write 0xE0 in the CAL_CFG1 Register during the initialization of the microcontroller . This was done in order to enable the test signal on the IRQ pin of the bq32000. bit 7 = OUT = 1 bit 6 = FT = 1 bit 5 = S = 1 bit 4, bit 3, bit 2, bit 1, bit 0 = CAL = 00000 2. Write 0xFF in the CAL_CFG1 Register. This was done in order to speed the RTC. bit 7 = OUT = 1 bit 6 = FT = 1 bit 5 = S = 1 bit 4, bit 3, bit 2, bit 1, bit 0 = CAL = 11111 This is : CAL(DEC) 31 = -126 ppm. 3. Write the key 0x5E in the SF KEY 1 register. 4. Write the key 0xC7 in the SF KEY 2 register. 5. Set the bit FTF (D0) in the SFR Register. Setting FTF forces the calibration signal to 1Hz, and the calibration tracks the internal ppm adjustment. 6. Read the calibration register CAL_CFG1 Register in order to verify that the bits 4, 3, 2, 1 and 0 = 11111 . 7. Finally, the initial value 10000000b is written to the CAL_CFG1 Register. The control system continues to be delayed one minute per week, if someone has an idea of something else that could be done please let me know. Thanks all.
  2. HI all !! Please guide me, how to makes 2 Msp430g2553 working together ???? I don't understand when i using i2C to interface, what is slave address?? and what is master address?? Thanks you so much !!
  3. Thanks you so much ! Maybe I understands your idea !!
  4. leetrieu

    EEPROM 24C04 interface to a MSP430G2553

    Thanks you ! I started new topic here, please give me your idea !! http://forum.43oh.com/topic/4412-help-how-to-make-2-devices-working-together-using-i2c/
  5. Hello everybody !! I have a problem with I2C. I don't known how to make 2 devices working together using the same I2C bus. this is my code to interface with RTC(BQ32000) //************************* void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; conf_io(); conf_lcd(0); conf_clock(); i2c_init(0x68); //initialization I2C BQ32000 i2c_write(0x00,8,datawrite); //Set Time for BQ32000 while(1) { read_bq32000();//readtime from BQ32000 display_time(); //Show Time on LCD display_date();//Show Date on LCD } } and code interface with EEPROM 24C04 #include "msp430g2553.h" #include "I2C.c" unsigned char datawrite[4]={0x4f,0x48,0xab,0x13}; unsigned char dataread[4]; unsigned char tmp1,tmp2,tmp3,tmp4; void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; P1DIR |= 0x0f; P1SEL |= BIT6 + BIT7; // Assign I2C pins to USCI_B0 P1SEL2|= BIT6 + BIT7; i2c_init(0x50); i2c_write(0x01,5,datawrite);//write 3 value from datawrite to 0x01,0x02 and 0x03 registers __delay_cycles(50000); i2c_read(0x01,2,dataread);//First read while(1) { i2c_read(0x01,5,dataread);//read 3 regiters: 0x01,0x02 and 0x03 tmp1=dataread[0]; //0x01 -> tmp1 tmp2=dataread[1]; //0x02 -> tmp2 tmp3=dataread[2]; //0x03 -> tmp3 tmp4=dataread[3]; // read 0x04 _NOP(); } } I only can interface with RTC or 24C04, but I can't make it working together?? Please guide me how to do it? Thanks all so much !!
  6. leetrieu

    EEPROM 24C04 interface to a MSP430G2553

    Thanks you so much !!! I sloved my problem with "read twice" and now it is really working !! Today, I have a problem with two I2C devices. There are RTC(BQ3200) and 24C04. I don't known, how do these two devices work together?? Please guide me !! Thanks all !!
  7. leetrieu

    EEPROM 24C04 interface to a MSP430G2553

    Thanks you so much !! It working but i have a little problem, please help me explain it ? I using below code to test: #include "msp430g2553.h" #include "I2C.c" unsigned char datawrite[3]={0x3f,0x13,0x21}; unsigned char dataread[4]; unsigned char tmp1,tmp2,tmp3,tmp4; void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; P1DIR |= 0x0f; P1SEL |= BIT6 + BIT7; // Assign I2C pins to USCI_B0 P1SEL2|= BIT6 + BIT7; i2c_init(0x50); i2c_write(0x01,3,datawrite);//write 3 value from datawrite to 0x01,0x02 and 0x03 registers __delay_cycles(50000); while(1) { i2c_read(0x01,4,dataread);//read 3 regiters: 0x01,0x02 and 0x03 tmp1=dataread[0]; //0x01 -> tmp1 tmp2=dataread[1]; //0x02 -> tmp2 tmp3=dataread[2]; //0x03 -> tmp3 tmp4=dataread[3]; // read 0x04 _NOP(); } } I don't understand, why it return values don't exactly in first debug?? but in second debug it true :? please see below picture to understand my question ! Thanks all !!!
  8. leetrieu

    EEPROM 24C04 interface to a MSP430G2553

    Thanks for your answer !! But I sure I removed it, please review my code and tell me what happen with it?? I did used this I2C Library for my RTC BQ32000, it still working but with 24C04 it hang in that command. while (!(IFG2&UCB0TXIFG));
  9. I'm tired to interface 24C04 with msp430g2553. Please help me !! this is my hardware: This is code in main.c #include "msp430g2553.h" #include "I2C.c" unsigned char datawrite[2]={2,8}; unsigned char dataread[2]; unsigned char i,j; void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; i2c_init(0xa0); i2c_write(0x00,2,datawrite); while(1) { i=dataread[0]; j=dataread[1]; } } When i debug it hang on command line: while (!(IFG2&UCB0TXIFG)); Please guide me !! Thanks all so much !! EEPROM 24C04.rar
  10. leetrieu

    Interfacing 3x4 with keypad matrix

    Hi Touch ~!! Can you tell me how can i receive value when i press button on keypad??? you are using UART???? If i don't want to use UART, How can i save value of a key??? Thanks you so much !!!
  11. leetrieu

    [Help] 4x4 Matrix Keypad

    #include <Keypad.h> const byte ROWS = 4; //four rows const byte COLS = 3; //three columns char keys[ROWS][COLS] = { {'1','2','3'}, {'4','5','6'}, {'7','8','9'}, {'*','0','#'} }; byte rowPins[ROWS] = {P1_6,P1_7,P2_2,P1_0}; //connect to the row pinouts of the keypad byte colPins[COLS] = {P1_5,P1_4,P1_3}; //connect to the column pinouts of the keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup(){ Serial.begin(9600); } void loop(){ char key = keypad.getKey(); if (key){ Serial.println(key); } } can you help me modify this code for msp430??? I'm really need the code like this for my application. Please help me !! Thanks all! !
  12. leetrieu

    [Help] 4x4 Matrix Keypad

    Thanks you so much !! Please tell me your idea about "Simple Digital clock"??? I want to design a simple digital clock using msp430. Hope all help me design it ?? Thanks all ! PS: So sorry, my english so bad !!
  13. leetrieu

    [Help] 4x4 Matrix Keypad

    Hello every body !!| I'm a new user of msp430. who can help me using 4x4 matrix keypad please?? I have a project need interface with 4x4 keypad. please give me a single sample !! Thanks alll!
×