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.

EK-LM4F120XL LaunchPad Workshop Lab5 = FaultISR!!

Hi,

I'm currently working my way the though this launch pad workshop and I have reached an impasse. I have had no problems getting the other examples working on my board. But Lab5, which is to do with ADC12, doesn't seem to want to play ball. It compiles ok, but goes straight into the FaultISR loop when I try to run it.

This is the two lines of code where the problem occurs:

SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);    <------ this part works ok, the ADC is enabled

SysCtlADCSpeedSet(SYSCTL_ADCSPEED_250KSPS);  <----this part, for some unknown reason, appears to be disabling the ADC! I have no idea why!

The next step addresses the ADC, which isn't enabled anymore, so a Hard fault is created. But why is the ADC being disabled???

Has anyone else came across this?

Any help is much appreciated.

Thanks,

Crawford.

  • Hi Crawford,

    I have tried the lab 5  and it works well on my launchpad. I think there should be some changes made to your source code. The attachment is my project, please run it on your board and see whether it works well. Thanks!

    http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/471/7266.Lab5.7z

  • Hi Jason,

    Thanks for this, but I can't get your project work. I appear to be working from a different file set to you. I have been using Tivaware. The Stellarisware that included the LM4F120 files doesn't appear to be available any more. It makes trying to follow these examples very confusing.

    C.

  • Call off the search! I managed to find a version of Stellarisware that includes LM4 files. I now have the software working on my Launchpad.

  • Hi Crawford,

     

       Regarding the TivaWare issue, please take a look at the following information from Section 21.2.2.22 of the TivaWare Peripheral Driver Library User's Guide v1.0:

     

       You can add a statement after the call to SysCtlPeripheralEnable( SYSCTL_PERIPH_ADC0) that is unrelated to the ADC0 peripheral.   Maybe enable one of the GPIO ports that you will need:

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);

        Do this before you call SysCtlADCSpeedSet(...), and see if the problem is resolved.

      

        I understand that you moved back to StellarsWare, but you may want to move up to TivaWare for your project. 

        Please let me know if this helps. 

     

         Best,

     

         Rick Nardone

       

       

  • Hi Rick,

    Thanks for the reply. I was aware of the 5 clock cycles need to enable a peripheral, and did put in a delay as you suggest. But it didn't help.

    I managed to get the first 4 labs running ok, but the 5th just wouldn't work, no matter what I tried. Now that I have the old Stellarisware for the LM4 device it works fine. It suggests to me that there is a problem with the Tivaware for the ADC when using the LM4F120 eval kit.

    I would suggest someone at TI needs to try out the labs using Tivaware to make sure. I wasted a lot of time on this. Very frustrating.

    Regards,

    Crawford

  • Hi Crawford,

    Thanks for the heads up on this problem.  Can you tell me what tool chain you are using please?  (CCS v5.3, IAR EW, Keil uVision, ??)

    Best,

        Rick

  • Hi Rick,

    I'm using CCS v5.3.

    C.

  • Hi Crawford,

    Thanks for your time and efforts.  I'll try to reproduce the problem, and get it resolved.   I would expect there are some changes necessary to port the labs from StellarisWare to the new version of TivaWare.  I've attached an app note on the topic.

     

     

     Best,

              Rick

    spma050.pdf
  • Thanks Rick. No doubt it will just have been me being clueless, but I would be interested to know how you get on either way.

    C.

  • I can confirm the original poster's issue: the clock to the adc module is quickly disabled after it is enabled.

    The board is one of the earliest LM4F120 board.

    The solution that worked for me is this:

    1) immediately reenable the adc clock, right after setting the adc speed;

    2) use PLL as the master clock.

    The issue does not exist on newer LM4F120 / 1233 boards.