Jump to content


  • Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    cry_viem reacted to L.R.A in Reset Tiva C by sorfware   
    The code vault is to post working codes, not to ask questions, please refer to the general forum for that.
    if you check the datasheet you can see all the reset sources, i image you are using the tm4c123 launchpad: Reset Sources The TM4C123GH6PM microcontroller has six sources of reset: 1. Power-on reset (POR) (see page 214). 2. External reset input pin (RST) assertion (see page 215). 3. A brown-out detection that can be caused by any of the following events: (see page 216). ■ V DD under BOR0. The trigger value is the highest VDD voltage level for BOR0. ■ VDD under BOR1. The trigger value is the highest VDD voltage level for BOR1. 4. Software-initiated reset (with the software reset registers) (see page 217). 5. A watchdog timer reset condition violation (see page 217). 6. MOSC failure (see page 218).  
    If you use TivaWare you can do SysCtlReset(void);, For a reset with only using registers please check page 217 of the datasheet
  2. Like
    cry_viem reacted to igor in eeprom interface   
    Are you talking the internal EEPROM, or using an external one?
    If Internal:
    Be sure to read the errata, your code should check which version of the chip it is running on, since some versions have a bug where using the internal EEPROM will brick the chip.
    You didn't mention what programming language/environment you are using.
    If you are using Energia, there is a library for accessing onboard EEPROM.  (Which unfortunately does not do the appropriate check for chip version).
    If you are using Tivaware/Stellarisware - there are library calls to access the eeprom (driverlib/eeprom.h, eeprom.c)
    If not using either - look at the source code for the above libraries to learn how to program the EEPROM.
    (If using eLua - I have an EEPROM library on the back burner someplace ;-)
    If you are using an external EEPROM - there are some Energia libraries for some types I believe.
    But need to specify what interface,  (SPI, ...), chip, data sheet, etc.
    General thoughts:
    For future reference, this particular forum is more for posting code, your question is more likely to be seen in the general forum (as the listing says "Beginners, feel free to ask your questions here." )
  3. Like
    cry_viem reacted to Lyon in QEI module   
    Your guess is correct - lm4f120h5qr (re-named TM4C1233H6PM) does not have QEI module.
  4. Like
    cry_viem reacted to igor in Interrupt works on for one button but not the other?   
    Port F pin 0 has special function (NMI), so you have to do a special incantation to program it as an input.
    See drivers/buttons.h in stellarisware for an example

  5. Like
    cry_viem reacted to mbeals in Interrupt works on for one button but not the other?   
    I'm in the process of figuring out how interrupts and timers work on this board, so I wrote a short program to adjust the brightness of the blue led by clicking on either button.  The left button trips the interrupt just fine and does what it is supposed to....but the right button will not, even though it is configured identically.  I even tried a simpler version of the code in which would only interrupt pin 0 or pin 4, and even then it will not interrupt on pin 0.  I also tried clearing both interrupts right before entering the main loop, and it didn't help.
    It has to be something stupid simple, but I can't see it.  The code is below
    #include "inc/hw_types.h" #include "inc/hw_memmap.h" #include "inc/hw_ints.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "driverlib/timer.h" #include "driverlib/pin_map.h" #include "driverlib/interrupt.h" volatile unsigned long ulPeriod = 1000; volatile unsigned long dutyCycle = 250; int main(void) { // 40 MHz system clock SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); /*Pwm the blue LED*/ // Configure PF2 as T1CCP0 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinConfigure(GPIO_PF2_T1CCP0); GPIOPinTypeTimer(GPIO_PORTF_BASE, GPIO_PIN_2); // Configure timer SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1); TimerConfigure(TIMER1_BASE, TIMER_CFG_SPLIT_PAIR|TIMER_CFG_A_PWM); TimerLoadSet(TIMER1_BASE, TIMER_A, ulPeriod -1); TimerMatchSet(TIMER1_BASE, TIMER_A, dutyCycle); // PWM TimerEnable(TIMER1_BASE, TIMER_A); /* Configure buttons for input */ GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_0|GPIO_PIN_4); GPIOPadConfigSet(GPIO_PORTF_BASE,GPIO_PIN_0|GPIO_PIN_4,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU); GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_0|GPIO_PIN_4, GPIO_FALLING_EDGE); GPIOPinIntEnable(GPIO_PORTF_BASE, GPIO_PIN_0|GPIO_PIN_4); /* Configure interrupt for buttons */ IntEnable(INT_GPIOF); IntMasterEnable(); while(1){} } void IntGPIOF(void) { if (GPIOPinIntStatus(GPIO_PORTF_BASE, GPIO_PIN_0) & GPIO_PIN_0) { GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_0); TimerMatchSet(TIMER1_BASE, TIMER_A, dutyCycle+=100); if(dutyCycle >= ulPeriod - 1) dutyCycle = 0; }else{ GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_4); TimerMatchSet(TIMER1_BASE, TIMER_A, dutyCycle-=100); if(dutyCycle < 100 ) dutyCycle = ulPeriod - 1; } }
  6. Like
    cry_viem reacted to Lyon in gpio   
    PF0 is the NMI pin (also PD7) so you must to unlock it first before using it.
    See how to here: http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/284566.aspx
  • Create New...