dessel191

PM main.c

Nov 13th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.57 KB | None | 0 0
  1. /****************************************************************
  2. KPIT Cummins Infosystems Ltd, Pune, India. - 10-Mar-2003.
  3.  
  4. This program is distributed in the hope that it will be useful,
  5. but WITHOUT ANY WARRANTY; without even the implied warranty of
  6. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  7. *****************************************************************/
  8.  
  9. /*****************************************************************
  10. program testowy, zadawanie czestotliwosci z potencjometry 100Hz - 5kHz z dokladnoscia do 10 Hz
  11. ustawianie wypelnienia 5-95 z klawiatury, podobnie z klawiatury start i stop ukladu
  12.  
  13. *****************************************************************/
  14.  
  15. #include "iodefine.h"
  16. #include "lcd.h"
  17. #include "inline.h"
  18.  
  19.  
  20. //deklaracje funkcji z main
  21.  
  22. void Ekran_startowy(void);
  23.  
  24. short count;
  25. unsigned short pomiar = 0;
  26. unsigned short tmp;
  27.  
  28. //------------ wlasciwy program -----------------------------------
  29.  
  30. int main (void)
  31. {
  32.    
  33.     IniLCD();
  34.     Ekran_startowy();
  35.    
  36.     count = 100;
  37.  
  38.  
  39.     while(1)                        //petla glowna
  40.     {
  41.        
  42.        
  43.         if( ITU0.TSR.BIT.IMFA )    
  44.         {
  45.             ITU0.TSR.BIT.IMFA=0;
  46.             count--;
  47.             if(!count)
  48.             {
  49.                 PB.DR.BYTE^=0x01; //sygnalizacja na LED
  50.                 count = 100;
  51.             }
  52.         }  
  53.        
  54.     // ##### Coś jest zdupione z przetwornikiem
  55.     // ##### to powinno działać a nie chce
  56.  
  57.             pomiar = AD.ADDRB;         
  58.             pomiar>>6;     
  59.            
  60.        
  61.         GotoXY(1,1);
  62.         putshort(pomiar);
  63.            
  64.     }
  65.    
  66.  
  67. }
  68.  
  69.  
  70.  
  71. //------- ekran startowy po wlaczeniu ukladu
  72.  
  73. void Ekran_startowy(void)
  74. {
  75.     GotoXY(1,1);
  76.     putshort(111);
  77.     GotoXY(2,1);
  78.     putnumber(201);
  79. }
Advertisement
Add Comment
Please, Sign In to add comment