TI E2E Community
Stellaris® ARM® Microcontrollers
Stellaris® ARM® LM3S Microcontrollers Forum
Real Time Clock in LM3S6965
according to sample program (enet_io) provided with kit cortex lm3s6965, i control the on/off of lamp which is connected to the led.
In this project LAMP is on/off according to the choice user given(i.e. by tick on the check box).
Now my next step is that I want that at 7.00am LAMP will be automatically off; & at 7.00pm LAMP will be automatically on.
For that i think that i have to use Real Time Clock(RTC). I am totally blank for RTC .
So kindly tell me steps i have to follow for that.
Thanks in advance.
There are a number of ways to accomplish this goal. Here is one way:
1. Use the external crystal to generate a precise number of SysTick interrupts per second. See the interrupts example application.
2. Use the number of interrupts to track the time. You could use the qs-logger application from the EK-LM4F232 as an example.
3. When the time matches specific set points, control an external circuit or send commands to a module to control the lamp. One solution is to use the X10 line of home automation products. It appears they have modules that can be controller with a serial port.
can you send me the link for the interrupts example application or any pdf file regarding this ?
Download and install the LM3S6965 StellarisWare package on this page -- http://www.ti.com/mcu/docs/mcuorphantoolsw.tsp?sectionId=632&orphantabId=8
You can find the interrupts example in boards/ek-lm3s6865/interrupts.
i read interrupt program .Also with kit lm3s6965 in boards/ek-lm3s6965/timer ,timer example is given.
This example application demonstrates the use of the timers to generate periodic interrupts. One timer is set up to interrupt once per second and the other to interrupt twice per second; each interrupt handler will toggle its own indicator on the display. Same program can i use for switching OFF lamp at 7.00am and ON at 7.00pm.
But for that ,timer is set up such that it interrupt at 7.00am and 7.00pm.
For that what should be delay i have to given?
Also in the datasheet of lm3s6965 it is told that general purpose timer modules can be Real-Time Clock when using an external 32.768-KHz clock as the input.
How this external clock can be given?
Whether this clock affect the clok which is used for programming? In progamming clocking is set to run directly from the crystal by using SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
You will have to develop a clock that keeps track of the current date and time. There is an example of this in the ek-lm4f232 qs-logger application. In essence, you will have to have separate variables that keep track of the hour, minute, and seconds. The time will be advanced every second during the timer interrupt. You will have to update the clock to the current date and time using keypad and display. Next you will have to add checks for when clock equals 7.00am or 7.00pm.
Using the timer module to produce the 1 HZ pulse could be more accurate (timing wise) and could be used if you do not want to model the date and time. It would require that you count from 0 to 43200 (the number of seconds in 12 hours). This would be problematic since you would have to have start the MCU exactly 12 hours before you want it to trigger. The 32,768 Hz external clock is driven on an even CPP pin. There is no sysctl function needed.
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.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.