• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » LM3S9B96 1-Pin Clock Source
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • Stellaris PinMux Utility
  • Stellaris® LM4F120 LaunchPad
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • LM3S9B96 1-Pin Clock Source

    LM3S9B96 1-Pin Clock Source

    This question is answered
    Justin Forrester
    Posted by Justin Forrester
    on Apr 25 2012 12:44 PM
    Expert1015 points

    Hello,

    I am attempting to use a 78 MHz oscillator instead of the crystal that I have been using, but the debugger seems to stop functioning shortly after I set the clock source in the code.

    Could I get a confirmation that I am going about this in the correct manner?  The code and circuit changes I have made are as such:

    #define EXT_OSC 1
    #define EXTERNAL_OSC_RATE 78000000

    void setInitialClock() {
        if(EXT_OSC)
            SysCtlClockSet(SYSCTL_USE_OSC | SYSCTL_OSC_MAIN); // External Source
        else
            SysCtlClockSet( SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN ); // 40MHz - Ext
    }

    And I have changed all peripheral initializations to use the EXTERNAL_OSC_RATE instead of SysCtlClockGet(), as in:

    void initI2C() {
        SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
        GPIOPinConfigure(GPIO_PB2_I2C0SCL);
        GPIOPinConfigure(GPIO_PB3_I2C0SDA);
        GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3);
        if(EXT_OSC)
            I2CMasterInitExpClk(I2C0_MASTER_BASE, EXTERNAL_OSC_RATE, false);
        else
            I2CMasterInitExpClk(I2C0_MASTER_BASE, SysCtlClockGet(), false);
    }

    The oscillator circuit is as such (with X2, C28, and C29 removed):

    Oscillator Circuit

    clock LM3S9B96
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Bobby Bradford
      Posted by Bobby Bradford
      on Apr 25 2012 12:58 PM
      Genius9030 points

      I will need to look up a few things before I can answer this question.  However, which Stellaris device are you using for this application?

      --Bobby

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bobby Bradford
      Posted by Bobby Bradford
      on Apr 25 2012 12:59 PM
      Genius9030 points

      Oops, failed to look at the title of the post ... LM3S9B96.  Long day already :-)

      --Bobby

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 25 2012 13:08 PM
      Expert1015 points

      Thanks.  Also, the oscillator I am using is the programmable Abracon ASEMB-Blank, which I have programmed at 78 MHz.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bobby Bradford
      Posted by Bobby Bradford
      on Apr 25 2012 13:14 PM
      Genius9030 points

      According to the data sheet, Section 26.8.1, Table 26-7, the maximum frequency that can be used in this mode is 16.384 MHz..

      --Bobby

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 25 2012 13:39 PM
      Expert1015 points

      Please see this post: http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/t/112917.aspx

      The datasheet is incorrect on that point.  If my code is wrong for this setup, how should it be corrected?

      Thanks!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 25 2012 15:30 PM
      Expert1015 points

      Also: http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/t/119876.aspx

      In specific, I want to use an external oscillator so that I may use that frequency as the base for the CAN interface baud rate, so that I can have better frequency options with our controller module which uses a base of 26 MHz.  What do I need to do now that I have an external oscillator in order to make this happen?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 25 2012 18:04 PM
      Expert1015 points

      In http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/p/133209/483753.aspx it was determined that the proper way to set up a 50MHz oscillator is with this call: SysCtlClockSet ( SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_SYSDIV_1);

      I have made that change, but I am still having the same issue.  Can I get a confirmation that the circuit I am using is appropriate for the Stellaris?  I was unable to find an example specifically for the Stellaris, so I used one I found for the AM3517.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 25 2012 19:47 PM
      Expert1015 points

      Update: Swapped out the oscillator for one programmed at 26 MHz and I can now step through the code in the debugger.  However, when I scope the OSC0 pin, the signal is only 1.72 V peak to peak.  Could I get a confirmation that the datasheet is correct with the maximum low voltage on the OSC0 pin is 0.5V and the minimum high (at VDD=3.3) is 2.8V?  It seems like it should not be working right now.

      Thanks!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Sue Cozart
      Posted by Sue Cozart
      on Apr 25 2012 20:39 PM
      Guru50070 points

      Justin,

      Are you using an active probe to measure the voltage?

      Regards,

      Sue

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 26 2012 10:27 AM
      Expert1015 points

      Sue,

      Unfortunately I am only using a passive probe.

      Thanks,

      Justin

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Sue Cozart
      Posted by Sue Cozart
      on Apr 26 2012 11:26 AM
      Guru50070 points

      A passive probe will damp the oscillation, so you are not seeing the true amplitude of the signal.

      Regards,

      Sue

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • cb1_mobile
      Posted by cb1_mobile
      on Apr 26 2012 12:44 PM
      Guru21760 points

      Might not a premium, very fast buffer from TI - interposed between osc_out and poster's scope probe - serve as "poor-man's" active-lite probe?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on May 01 2012 18:46 PM
      Expert1015 points

      Okay, then assuming that the oscillator is operating correctly - how do I set this up to work? Is there something extra I need to do for it to work at 78 MHz as opposed to 26 MHz? Again, I am using this line of code:

      SysCtlClockSet ( SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_SYSDIV_1);

      Is this correct?

      Thanks,

      Justin

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Sue Cozart
      Posted by Sue Cozart
      on May 01 2012 21:43 PM
      Guru50070 points

      Hi Justin,

      I'm sorry I didn't catch this before.  The maximum frequency for an external clock reference is 50 MHz - see table 26-11 in the data sheet.  Your SysCtlClockSet function is correct.

      Regards,

      Sue

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on May 02 2012 14:32 PM
      Expert1015 points

      Thanks Sue. I was looking on an older datasheet where the same table specified 80 MHz. Okay, using 39 MHz I have been able to test that SPI, i2C, and CAN work from the external oscillator. However, I am having trouble using the EPI bus with my SRAM chip. It works fine at 40 MHz PLL, but using the 39 MHz oscillator I get seemingly random data when I read back from SRAM. Is there any modification that I would need to make to the EPI initialization to take into account this different clock source?

      My EPI initialization is:

      SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);

      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
      SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);

      GPIOPinConfigure(GPIO_PH3_EPI0S0);
      GPIOPinConfigure(GPIO_PH2_EPI0S1);
      GPIOPinConfigure(GPIO_PC4_EPI0S2);
      GPIOPinConfigure(GPIO_PC5_EPI0S3);
      GPIOPinConfigure(GPIO_PC6_EPI0S4);
      GPIOPinConfigure(GPIO_PC7_EPI0S5);
      GPIOPinConfigure(GPIO_PH0_EPI0S6);
      GPIOPinConfigure(GPIO_PH1_EPI0S7);
      GPIOPinConfigure(GPIO_PE0_EPI0S8);
      GPIOPinConfigure(GPIO_PE1_EPI0S9);
      GPIOPinConfigure(GPIO_PH4_EPI0S10);
      GPIOPinConfigure(GPIO_PH5_EPI0S11);
      GPIOPinConfigure(GPIO_PF4_EPI0S12);
      GPIOPinConfigure(GPIO_PG0_EPI0S13);
      GPIOPinConfigure(GPIO_PG1_EPI0S14);
      GPIOPinConfigure(GPIO_PF5_EPI0S15);
      GPIOPinConfigure(GPIO_PJ0_EPI0S16);
      GPIOPinConfigure(GPIO_PJ1_EPI0S17);
      GPIOPinConfigure(GPIO_PJ2_EPI0S18);
      GPIOPinConfigure(GPIO_PJ3_EPI0S19);
      GPIOPinConfigure(GPIO_PD2_EPI0S20);
      GPIOPinConfigure(GPIO_PD3_EPI0S21);
      GPIOPinConfigure(GPIO_PB5_EPI0S22);
      GPIOPinConfigure(GPIO_PB4_EPI0S23);
      GPIOPinConfigure(GPIO_PE2_EPI0S24);
      GPIOPinConfigure(GPIO_PE3_EPI0S25);
      GPIOPinConfigure(GPIO_PH6_EPI0S26);
      GPIOPinConfigure(GPIO_PH7_EPI0S27);
      GPIOPinConfigure(GPIO_PJ4_EPI0S28);
      GPIOPinConfigure(GPIO_PJ5_EPI0S29);
      GPIOPinConfigure(GPIO_PJ6_EPI0S30);
      GPIOPinConfigure(GPIO_PG7_EPI0S31);

      GPIOPinTypeEPI(GPIO_PORTB_BASE, EPI_PORTB_PINS);
      GPIOPinTypeEPI(GPIO_PORTC_BASE, EPI_PORTC_PINS);
      GPIOPinTypeEPI(GPIO_PORTD_BASE, EPI_PORTD_PINS);
      GPIOPinTypeEPI(GPIO_PORTE_BASE, EPI_PORTE_PINS);
      GPIOPinTypeEPI(GPIO_PORTF_BASE, EPI_PORTF_PINS);
      GPIOPinTypeEPI(GPIO_PORTG_BASE, EPI_PORTG_PINS);
      GPIOPinTypeEPI(GPIO_PORTH_BASE, EPI_PORTH_PINS);
      GPIOPinTypeEPI(GPIO_PORTJ_BASE, EPI_PORTJ_PINS);

      EPIDividerSet(EPI0_BASE, 0);

      EPIModeSet(EPI0_BASE, EPI_MODE_HB8);

      EPIConfigHB8Set(EPI0_BASE, (EPI_HB8_MODE_ADMUX | EPI_HB8_WRWAIT_1 |
      EPI_HB8_RDWAIT_1 | EPI_HB8_WORD_ACCESS), 0);

      EPIAddressMapSet(EPI0_BASE, (EPI_ADDR_RAM_SIZE_256MB |
      EPI_ADDR_RAM_BASE_6) );

      while(HWREG(EPI0_BASE + EPI_O_STAT) & EPI_STAT_INITSEQ)

      {

      }

      sram = (unsigned long *)0x68000000;

      Thanks!

      Justin

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use