1 2 3 Previous Next 34 Replies Latest reply on Sep 17, 2015 4:46 PM by user_242978793

    Why My LED is not Blinking ?

    user_444739275
              Hello please look my workspace Why My LED is not Blinking ?   
        • 1. Re: Why My LED is not Blinking ?
          user_1377889

          Different from your comment, the time you set initially is the very same time you set for the alarm. Install the 5 seconds difference and it might work.

             

           

             

          Bob

          • 2. Re: Why My LED is not Blinking ?
            user_444739275
                    Hello about few hours ago My Pscoc creator was working very good. but now I am getting error message.'' device driver software was not successfully Installed'' Now I can't test program,   
            • 3. Re: Why My LED is not Blinking ?
              user_242978793

              I have been looking at your program and I have found some issues.  I had to add a software UART to check if your program was working. I 1) found the clock is not running.  That is why your Alarm is not going off.  2) resistor is 560 ohms not 460 ohms. 3) Led was marked as a Diode not a LED.  3) You have the LCD on the wrong port. Port 2 is for analog per the PSOC Specs. It should be on Port 0 or Port 1. 4) You have not set the  LCD_Start(); in your program for the LCD. This is required for the LCD to be setup correctly. 5) Set alarm mask is not correct.   You should remove the seconds from the alarm by using this command  RTC_SetAlarmMask((unit32)~RTC_ALARM_SEC_MASK); Yours instruction is not doing that.  6) You are missing the CySysTickStart(); from your program.

                 

              7) Reboot your computer to see if that fixes your programming issue.

              • 4. Re: Why My LED is not Blinking ?
                user_444739275

                Hello

                   

                Look My another Project workspace. Its working but there is one problem. LED does not turn Off when Alarm is off

                   

                alarm should be On for 100 ms then turn off Alarm

                   

                if alarm is ON then LED should be On and if alarm is off , LED should be turn OFF 

                • 5. Re: Why My LED is not Blinking ?
                  user_14586677

                  You never clear the alarm flag when the alarm clears. Also you toggle the

                     

                  LED rather than set it when flag is 1, clear it when flag is 0.

                     

                   

                     

                  Regards, Dana.

                  • 6. Re: Why My LED is not Blinking ?
                    user_444739275

                    when I put below code it works , when alarm is on , LED turn on for 5000 seconds and then turn off 

                       


                        void AlarmIsrHandler(void)
                    {
                       
                           alarmFlag = 1u;
                           Alarm_LED_Write(1);
                           CyDelay (5000);
                           alarmFlag  = 0u;
                     
                           Alarm_LED_Write(0);
                         
                        /* Clear interrupts state */
                        RTC_ClearAlarmStatus();
                    }

                       

                    Now first alarm become true , how to set multiple alarm , you told me I need to create flag

                       


                        void AlarmIsrHandler(void)
                    {
                       
                           alarmFlag1 = 1u;
                           Alarm_LED_Write(1);
                           CyDelay (5000);
                           alarmFlag1  = 0u;
                     
                           Alarm_LED_Write(0);
                         
                        /* Clear interrupts state */
                        RTC_ClearAlarmStatus();
                    }

                       


                       
                    {
                       
                           alarmFlag2 = 1u;
                           Alarm_LED_Write(1);
                           CyDelay (5000);
                           alarmFlag2  = 0u;
                     
                           Alarm_LED_Write(0);
                         
                        /* Clear interrupts state */
                        RTC_ClearAlarmStatus();
                    }

                    • 7. Re: Why My LED is not Blinking ?
                      user_14586677

                      You should not use large delays like that, wastes CPU time, accomplishes nothing.

                         

                      CPU just burns power, does nothing else like monitor other activity, etc.....

                         

                       

                         

                      Use a flag to control the alarm LED. Set when its on from alarm ISR, clear when it is alarm no

                         

                      longer valid.

                         

                       

                         

                      Regards, Dana.

                      • 8. Re: Why My LED is not Blinking ?
                        user_242978793

                        Vead your clock is running extremely fast. About 8 minutes for each real minute.  I check this with a stop watch and was not able to get a good start time but my readings are at least 8 or more minutes too fast. I have to ask why you have not used the programs I have sent to you in the past? They are running at the correct time.  I'll be modifying a working program and see it to you.

                        • 9. Re: Why My LED is not Blinking ?
                          user_444739275

                          I saw that Program , I don't have Miniprog, also I don't want to use ds1307 because RTC software component can work. so why we use ds1307. I don't care If some time loss occur. yes the clock is running very fast. I want to ask you, there is any way sothat we can get accurate time

                          • 10. Re: Why My LED is not Blinking ?
                            user_444739275

                             I am setting large delay to turn ON/OFF device for week , or months 

                               

                            your reply is same as your previous  answer

                               

                            suppose I want to set two alarms

                               

                            so that I used two flags

                               

                            alarmflag1

                               

                            alarmflag2

                               

                               void AlarmIsrHandler(void)
                            {
                               
                                   alarmFlag1 = 1u;
                                   Alarm_LED_Write(1);
                                   CyDelay (5000);
                                   alarmFlag1  = 0u;
                             
                                   Alarm_LED_Write(0);
                                 
                                /* Clear interrupts state */
                                RTC_ClearAlarmStatus();
                            }

                               

                               
                            {
                               
                                   alarmFlag2 = 1u;
                                   Alarm_LED_Write(1);
                                   CyDelay (5000);
                                   alarmFlag2  = 0u;
                             
                                   Alarm_LED_Write(0);
                                 
                                /* Clear interrupts state */
                                RTC_ClearAlarmStatus();
                            }

                            • 11. Re: Why My LED is not Blinking ?
                              user_242978793

                              I am not talking about the DS1307 clock program. This is a PSOC program that has a good clock source from the PSOC chip that is okay but not as good as a Crystal clock source. I should have the program done by later today. Do you want the LCD device on the program? if so I'll add that to the program an put it on the correct port.

                              • 12. Re: Why My LED is not Blinking ?
                                user_14586677

                                Using onboard OpAmp build a 32 Khz oscillator using external xtal.

                                   

                                 

                                   

                                http://www.edn.com/design/analog/4396957/Crystal-oscillator-circuit-is-ultralow-power

                                   

                                 

                                   

                                Regards, Dana.

                                • 13. Re: Why My LED is not Blinking ?
                                  user_14586677

                                  Scratch the prior post, I do not think there is any way to route the 32 Khz from

                                     

                                  an external pin to the RTC. Although datasheet states update of RTC can be mapped

                                     

                                  to a number of different interrupts. Possibly feed the external osc to a pin with an

                                     

                                  interrupt tied to it ? And mapped to the RTC ? Not sure if that would work. Possibly

                                     

                                  use the pin interrupt to register write and initiate in the ICU an interrupt the RTC

                                     

                                  can use.....

                                     

                                   

                                     

                                  The other way is to use a method during production test to cal the chips LO.

                                     

                                   

                                     

                                  Whats the accuracy target you have ?

                                     

                                   

                                     

                                  Regards, Dana.

                                  • 14. Re: Why My LED is not Blinking ?
                                    user_242978793

                                    VEAD: Here is a way to add a crystal to your CY8CKIT_049-42XX PSOC 4 Prototyping kit. http://www.cypress.com/file/140221/download and this document http://www.cypress.com/knowledge-base-article/implementing-32-khz-eco-interface-psoc-4100psoc-4200-kba95848. This will make your clock very accurate.  I am working on the program still I had a computer failure and changed to  another machine.

                                    1 2 3 Previous Next