亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c

?? 24位計數器的計數程序
?? C
字號:
//*****************************************************************************
//*****************************************************************************
//  FILENAME: main.c
//   Version: 1.0, Updated on 27 July 2004
//
//  DESCRIPTION: Main file of the Example_Counter24_28Pin Project.
//
//-----------------------------------------------------------------------------
//  Copyright (c) Cypress MicroSystems 2000-2003. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************

/*----------------------------------------------------------------------------
Project Objective
    To demonstrate the operation of the Counter24 user module of the PSoC microcontroller.  

    NOTE: OPTIONAL C COMPILER IS REQUIRED TO BUILD THIS PROJECT Compiler license 
    is available for purchase from http://www.onfulfillment.com/cypressstore/ 
    or your local distributor.

Overview
    A 24 bit Counter module counts the number of switch closures in 5 seconds and displays 
    the same on the LCD.   In this project, a counter24 is configured as a timer to get the 
    required Interrupt after every 5 seconds.

    Upon program execution all hardware settings from the device configuration are loaded 
    into the device and main.c is executed. The 24 MHz system clock is divided by 16 (VC1) 
    to produce a 1.5 MHz clock. This is given as input clock to the Counter24 user module 
    named "Counter24_Timer" which has a period of 7500000 (7499999+1), effectively producing 
    a TerminalCount interrupt at a duration of 5 seconds.  Another Counter24 user module 
    named "Counter24_Counter" has the input clock from P1[4] connected to a switch, which 
    goes high when closed.   As and when the switch is closed, this "Counter" registers it. 

    At every 5 seconds the Counter24_Timer generates an interrupt, during which the total 
    counts registered in the Counter24_Counter is output on the LCD and then it is reset 
    to start a fresh count for next five seconds.
    
    (Note : The switch has to be pressed properly to get the correct count)

Project Settings
    Global resources            
        VC1               = 16                 divide 24MHz clock by 16

    Counter24_Timer
        Clock             = VC1                Input is 1.5 MHz clock
        Enable            = High               Enabled for continuous operation.
        CompareOut        = None               Not used.
        TerminalCountOut  = None               Not used.
        Period            = 7499999            Set to 7499999 and count down to 0.
        CompareValue      = 0                  Not used.
        CompareType       = Less Than          Not used.
        InterruptType     = Terminal Count     To generate interrupt after
                                               the count reaches 0.
        ClockSync         = SyncToSysClk       Synchronize to system clock.
        TC_PulseWidth     = Full width         Generate a full pulse width
                                               at every terminal count.
        InvertEnable      = Normal             Not used.
    

    Counter24_Counter
        Clock             = Row_0_Input_0      Routed thru GlobalInOdd_4
        Enable            = High               Enabled for continuous operation.
        CompareOut        = None               Not used.
        TerminalCountOut  = None               Not used
        Period            = 99                 Set to 99 and count down to 0.
        CompareValue      = 0                  Not used.
        CompareType       = Less Than          Not used.
        InterruptType     = Terminal Count     Not used.
        ClockSync         = SyncToSysClk       Synchronize to system clock.
        TC_PulseWidth     = Full width         Not used.
        InvertEnable      = Normal             Not used.

    LCD
        LCDPort           = Port2              LCD at Port2.
        BarGraph          = Disable            Disable the BarGraph option of LCD.

Input 
    
    P1[4]          -    High Z, GlobalInOdd_4    Input from Switch.
    
Output
    P2[0]-P2[6]    -    Strong                    LCD output.        

How to use this with the Proto board

    CY3210-PSoCEVAL1
    - Connect an industry standard Hitachi HD44780 based LCD module in the LCD header.

    - Connect a 4.7k resistor from GND Pin of J5 to breadboard and from that point connect 
      a wire to P1[4] and from the same point connect a wire to SW (switch) in J5.  ie., in 
      simple terms, the P1[4] is pulled down to ground through a resistor and connected to 
      a switch, which connects to Vcc when closed.

CY3210-MiniEval1
    - In JP1, 1 and 2 to be connected  (for 28 pin operation)
    - Connect an industry standard Hitachi HD44780 based LCD module to Port2 as per 
      the diagram shown in datasheet of PSoC LCD user module.

//----------------------------------------------------------------------------
*/

//-------------------------------------------------------------------
// Include Files
//-------------------------------------------------------------------
#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules
#include "stdlib.h"		// included for itoa function

//-------------------------------------------------------------------
// C Interrupt Handlers
//-------------------------------------------------------------------
#pragma interrupt_handler Counter24_Timer_ISR_C        //for Counter24_Timer

//-----------------------------------------------------------------------------
//  FUNCTION NAME: Main
//
//  DESCRIPTION:
//      Main function. Performs system initialization and loops infinitely.
//      
//-----------------------------------------------------------------------------
//
//  ARGUMENTS:        None
//  RETURNS:          Nothing.
//  SIDE EFFECTS:     None.
//
//  THEORY of OPERATION or PROCEDURE:
//    1) Enable Interrupts of user modules and Global Interrupt
//    2) Loop infinitely
//
void main()
{
    // Initialize and start the LCD
    LCD_Start();                            

    // enable the global interrupt
    M8C_EnableGInt;                            
    
    // enable the Counter interrupt mask
    Counter24_Counter_EnableInt();        
    // start the Counter    
    Counter24_Counter_Start();                
    
    // enable the Counter(Timer) interrupt mask
    Counter24_Timer_EnableInt();            
    // start the Counter(Timer)
    Counter24_Timer_Start();                

    //Position the LCD to Row 1 column 1        
    LCD_Position(0,0);                        
    LCD_PrCString("Keep Pressing");            
    
    //Position the LCD to Row 2 column 1        
    LCD_Position(1,0);                        
    LCD_PrCString("Switch S1");                
    
    // Infinate loop.  Processing done only at the Counter24_Timer_ISR_C
    while(1);                                
}

//-----------------------------------------------------------------------------
//  FUNCTION NAME: Counter24_Timer_ISR_C
//
//  DESCRIPTION:
//      Interrupt Service routine of Counter24_Timer usermodule written in C.
//      The Counter24_Timer_ISR subroutine In the Counter24_TimerInt.asm file, 
//      redirects the flow to this subroutine.
//-----------------------------------------------------------------------------
//
//  ARGUMENTS:        None
//  RETURNS:          Nothing.
//  SIDE EFFECTS:     None.
//
//  THEORY of OPERATION or PROCEDURE:
//        This ISR is serviced on every Termincal count (ie., every 5 second)
//        Read the Counter24_Counter value and find out the elapsed count
//        and output on to the LCD.
//
void Counter24_Timer_ISR_C()
{
    //Initialize variables
    DWORD    dElapsedCount;
    char     sOutputStr[3];
    
    dElapsedCount = 0;
    
    //Read the counter and store the value in dElapsedCount
    Counter24_Counter_ReadCounter(&dElapsedCount);    
    
    //Clear the LCD
    LCD_Control(0x01);                                
    
    //subtract the counter Value from 99 (ie., the period) to get the elapsed count.
    dElapsedCount = 99 - dElapsedCount;                

    //convert the value of elapsed count to ascii using Interger to Ascii function (itoa)
    itoa(sOutputStr,dElapsedCount,10);                

    //Position the LCD to Row 1 column 1        
    LCD_Position(0,0);                                
    LCD_PrCString("Switch S1 was");                    
    
    //Position the LCD to Row 2 column 1        
    LCD_Position(1,0);                            
    LCD_PrCString("pressed ");                        
    
    //Send the elapsed count to LCD
    LCD_PrString(sOutputStr);                        
    LCD_PrCString(" times");                        
    
    //stop the counter before reloading the period. (if counter is stopped, then 
    //the period value when written, latches onto counter value)
    Counter24_Counter_Stop();                        

    //reload the write period so that the counter starts a fresh count down.
    Counter24_Counter_WritePeriod(99);                
                                                    
    //restart the counter
    Counter24_Counter_Start();                        
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91网站在线观看视频| 91免费视频网| 色综合天天综合网天天狠天天| 欧美在线短视频| 欧美韩日一区二区三区四区| 亚洲一卡二卡三卡四卡无卡久久 | 久久久精品黄色| 亚洲综合色自拍一区| 成人综合在线观看| 26uuu久久天堂性欧美| 亚洲一区二区欧美| 91丨国产丨九色丨pron| 国产拍欧美日韩视频二区| 久久狠狠亚洲综合| 日本福利一区二区| 国产精品伦理在线| 国产成人精品亚洲日本在线桃色 | 午夜精品在线看| 日本伦理一区二区| 亚洲蜜臀av乱码久久精品| 国产99久久久久| 久久久久久久久久美女| 美洲天堂一区二卡三卡四卡视频 | 婷婷中文字幕一区三区| 91麻豆免费看片| 亚洲欧洲精品一区二区三区不卡| 国产一区二区视频在线播放| 日韩一区二区电影在线| 五月激情综合婷婷| 日韩一区二区三区视频| 日日摸夜夜添夜夜添国产精品| 91搞黄在线观看| 一区二区三区日韩在线观看| 在线一区二区三区四区五区| 亚洲视频电影在线| 色琪琪一区二区三区亚洲区| 亚洲欧洲日韩在线| 91福利在线观看| 亚洲精品老司机| 91丝袜美腿高跟国产极品老师 | 欧美一级二级三级蜜桃| 蜜臀91精品一区二区三区| 欧美一区二区三区免费视频| 亚洲午夜久久久久久久久电影网| 91久久精品日日躁夜夜躁欧美| 亚洲柠檬福利资源导航| 欧美日韩一区国产| 麻豆精品在线看| 国产三区在线成人av| 99久久婷婷国产综合精品电影 | 91免费版在线| 亚洲最新视频在线播放| 欧美精品 国产精品| 五月天视频一区| 国产亚洲精品aa| 色天天综合色天天久久| 日韩黄色一级片| 欧美国产日韩a欧美在线观看| 99re亚洲国产精品| 午夜精品福利一区二区三区蜜桃| 日韩三级免费观看| 成人一区在线看| 亚洲第一精品在线| 久久精品免费在线观看| 91成人在线观看喷潮| 久久国产生活片100| 国产精品高潮呻吟| 日韩欧美一卡二卡| 一本色道久久综合亚洲精品按摩| 亚洲成人精品一区| 国产亚洲一区二区三区四区| 色噜噜狠狠成人中文综合| 麻豆成人av在线| 国产精品福利av| 精品国产精品网麻豆系列| 色婷婷综合久久久中文一区二区 | 欧美一区日本一区韩国一区| 国产91在线看| 免费看欧美女人艹b| 中文字幕在线不卡| 欧美va亚洲va在线观看蝴蝶网| 91色综合久久久久婷婷| 美女视频网站久久| 伊人婷婷欧美激情| 国产视频一区在线观看| 制服丝袜av成人在线看| 97久久精品人人做人人爽| 久久99最新地址| 视频一区欧美精品| 一区二区三区资源| 日本一区二区成人| 日韩一级大片在线观看| 欧美老年两性高潮| 国产91精品一区二区麻豆网站| 日本成人在线不卡视频| 亚洲男同1069视频| 17c精品麻豆一区二区免费| 久久久综合激的五月天| 欧美精品日日鲁夜夜添| 色婷婷综合激情| 91亚洲男人天堂| 本田岬高潮一区二区三区| 国产九色sp调教91| 久久精品久久综合| 久久国产成人午夜av影院| 秋霞影院一区二区| 日本不卡高清视频| 日韩经典中文字幕一区| 午夜欧美一区二区三区在线播放| 亚洲精品国久久99热| 国产精品九色蝌蚪自拍| 国产欧美1区2区3区| 国产日韩精品一区二区三区| 亚洲精品在线观| 久久久久久久免费视频了| www亚洲一区| 久久久99精品免费观看| 久久久久久久久久久久久夜| 久久精品欧美一区二区三区不卡| 精品国产成人在线影院| 国产性天天综合网| 国产精品久久久久影院老司| 亚洲欧洲av在线| 一区二区国产视频| 亚洲高清视频的网址| 日韩精品一级中文字幕精品视频免费观看 | 久久欧美中文字幕| 日本一区二区三区久久久久久久久不 | 欧美激情自拍偷拍| 国产精品激情偷乱一区二区∴| 国产精品国产三级国产a| 自拍av一区二区三区| 亚洲影视资源网| 免费观看在线综合色| 国模娜娜一区二区三区| 国产福利一区二区三区| 91香蕉视频黄| 欧美理论在线播放| 国产午夜精品久久| 夜夜嗨av一区二区三区网页| 全部av―极品视觉盛宴亚洲| 国产丶欧美丶日本不卡视频| 99久久国产免费看| 欧美日韩aaaaaa| 国产日韩欧美在线一区| 亚洲国产wwwccc36天堂| 久久国产欧美日韩精品| 成人精品国产一区二区4080| 欧美日韩国产大片| 国产网站一区二区| 亚洲国产一二三| 国产一区二区三区精品欧美日韩一区二区三区| 国产人成一区二区三区影院| 亚洲欧洲综合另类| 极品瑜伽女神91| 色哟哟亚洲精品| 久久亚洲精品国产精品紫薇| 亚洲精品久久嫩草网站秘色| 高清成人在线观看| 欧美一卡二卡在线观看| 中文字幕一区二区三| 日本中文一区二区三区| av一区二区三区黑人| 日韩一区二区影院| 亚洲一区二区视频在线| 成人动漫av在线| 欧美精品一区二区三区久久久| 亚洲自拍欧美精品| 99久久久久免费精品国产| 久久综合久久99| 亚洲成人av资源| 欧日韩精品视频| 国产精品久久久久三级| 国产一区二区三区最好精华液| 91精品国产91综合久久蜜臀| 一区二区视频免费在线观看| 粉嫩绯色av一区二区在线观看 | 国内不卡的二区三区中文字幕| 色狠狠av一区二区三区| 亚洲国产精品99久久久久久久久| 日韩和欧美一区二区| 欧美日韩免费观看一区三区| 亚洲色图都市小说| 国产成人a级片| 2020日本不卡一区二区视频| 午夜影院在线观看欧美| 99久久综合国产精品| 久久久av毛片精品| 激情五月播播久久久精品| 欧美一区二区大片| 日韩高清一区在线| 欧美少妇bbb| 亚洲在线视频网站| 色www精品视频在线观看| 国产欧美精品一区aⅴ影院| 国产乱一区二区| 欧美国产成人精品| 成人黄色a**站在线观看| 亚洲国产精品二十页| 成人高清av在线|