This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5638 USB and RTC backup demo code.

Other Parts Discussed in Thread: MSP430F5638, MSP430WARE

Hello,

can anyone send the code example to setup USB as CDC and to setup RTC battery backup in a same design?

Louis 

  • I have a design USB used as CDC, and Battery backup RTC. when this design is in debug mode (JTAG plug in and debug code) the RTC 1 second interrupt is on. but after disconnected JTAG. cycle the power (example, cycle the USB connection), the RTC 1 second interrupt does not on anymore. does anyone know how to solve this?

    From more debug looks, the USB CDC using X2 timer. I think RTC use X1 timer, if the code starts X1, then x2 start will not pass, loop for ever. does anyone see this too. and how do you solve it?

    but if not start x1, in debug mode, the code can start USB port as COM3, and 1 second interrupt can trigger at the break point, or output pin can see. but if take the debug out, the output pin does not see the 1 second interrupt, put the debug on the interrupt code, it not change the pin state anymore. how to solve it, where to look for the error? any suggestions are welcome.

    Louis
  • Hello Louis,

    Can you post some demo code that demonstrates the issue you are experiencing? Please attach a .c file, zipped project folder, or insert a code snippet using Syntaxhighlighter under the rich formatting option.

    Regards,
    Ryan
  • Hi Ryan,

    The attached zip file is the code run on MSP430F5638, missing are the USB_API, USB_application, USB_config_USB_Core_Lib folders. they are same as MSP430ware_1_25_00_29 and also, missing MSP430 driverlib, they are same as msp430_1_25_00_29 driverlib\5xx_6xx files. 

    other build errors, you could remove them all out.  the key is in interrupt code, the RTC 1 seconds interrupt, it not interrupt on our board without JTAG/desug starts,  with JTAG/debug starts, it can generates the interrupts.   the goal is to calibrate XT1 output,, keep the battery on the device to backup the system clock.  when power apply to the hardware, MSP430F5638 generates the 1 seconds interrupt to keep the system time run correctly.

    right now, two issues, first is clock output on ACLK (Port6 pin2), not output waveform if jTAG/debug did not start;  The second is RTC 1 second interrupt, it does not generates if JTAG/Debug did not start on our board.   

    If you needs other information or has other questions, let me know,  I have a work e-mail at xliu@newgateinstruments.com.toRyan1.zip

    xuedong

  • Louis,

    This firmware is developed far beyond the example I requested, making it very hard to break down and debug. Are you comfortable sharing this much design information on a public forum? We can switch to offline and communicate via e-mail if necessary.

    You are using a very old version of MSPWare/Driverlib, the updated versions fix several bugs that could source the issue you are seeing.

    Now that I know more about your application and setup, the problem could center around crystal design failure as compared to firmware structure. The two issues you mention are related as the RTC is sourced by ACLK, if ACLK is not being output onto its designated pin correctly then the crystal is most likely not oscillating. You said that ACLK is output on P6.2 but this is confusing as P1.0 is connected to ACLK instead, so are you toggling the pin? Was this code working on a TI-provided EVM before you moved it to a custom PCB? Could you provide any design files (schematic, layout view, etc.)? In your tests is the JTAG still supplying Vcc to the MSP430 or are you supplying it with external power? What voltage level is used?

    Regards,
    Ryan
  • could we offline, through the e-mail, I have a hardware engineer, he would like to on the e-mail list too.
  • Hi Ryan,
    Send me a hello to my work e-mail or MyTI account with your offline e-mail, I will reply with all the information you are looking for.
    have a good night.
    Louis or Xuedong

**Attention** This is a public forum