Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > why does the LED7SEG not work ?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



why does the LED7SEG not work ?
Moderator:
RKRM

Post Reply
Follow this topic



why does the LED7SEG not work ?

nate posted on 18 Apr 2011 7:35 PM PST
Member
9 Forum Posts

 i tried to convert a analog signal to a digital one,using LED7SEG to show it ,but after adding the timer8 ,the system just don't work ,can you help?

this is my code ,thank you !

#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules
#pragma interrupt_handler timer
int TimerCount=0;
int iResult;
int i;

void main()
{
   
    M8C_EnableGInt;
    PGA_1_Start(PGA_1_MEDPOWER);
    ADCINC12_1_Start(ADCINC12_1_MEDPOWER);
    ADCINC12_1_GetSamples(0);
    Timer8_1_Start();
    Timer8_1_EnableInt();
 
 
    LED7SEG_1_Start();
   
    while(1)
    {
     if(ADCINC12_1_fIsDataAvailable()!=0)
     {
      iResult=ADCINC12_1_iGetData()+2048;
      ADCINC12_1_ClearFlag();
      iResult=iResult*5000.0/4096.0;
      
      LED7SEG_1_DispInt(i,1,4);
      
      if(iResult>2000)
      {
       PWM8_1_Start();
      }
      
      if(iResult<=2000)
      {
       PWM8_1_Stop();
      }
     }
    }// Insert your main routine code here.
}


 void timer()
 {
  TimerCount+=1;
  if(TimerCount==128)
   {
   i=iResult;
   TimerCount=0;
   }
 }




Re: why does the LED7SEG not work ?

U2 posted on 26 Apr 2011 02:40 AM PST
Cypress Employee
589 Forum Posts

Can you let us know about your hardware setup. Are you using a Cypress Development kit for development or any custom board. Can you as well let us know which device you are trying to use.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS 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. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

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 and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers 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.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20