dessel191

PM hwinit.c

Nov 13th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.54 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. Hardware initialisation routine called by the startup code before the
  11. sections are initialised.  Bus controller, and other essential hardware
  12. setup code should be placed here.
  13.  
  14. ***************************************************************************/
  15. #define LIMIT 20000
  16.  
  17. #include "iodefine.h"
  18.  
  19. void hw_initialise (void)
  20. {
  21.     // init timer
  22.     ITU0.TIER.BYTE=0xF8;
  23.     ITU0.TCR.BYTE=0xA3;
  24.     ITU0.TIOR.BYTE=0x88;
  25.     ITU0.TSR.BYTE=0xF8;
  26.     ITU0.GRA = LIMIT;
  27.     ITU.TSTR.BYTE = 0xE1;
  28.    
  29.     // init A/C
  30.    
  31.     AD.ADCSR.BYTE = 0x3A;  // Powinna dzałać a nie chce
  32.    
  33.     // TODO: add hardware initialisation code here
  34.    
  35.     BSC.ABWCR.BYTE=0xFB;    //ustaw szerokosc szyny danych dla poszczegolnych obszarow
  36.     BSC.ASTCR.BYTE=0x0F;    //ustaw 3 stanowy cykl na szynie, cs6-2stanowy
  37.     BSC.WCR.BYTE=0xF3;      //ustaw 3 wait-y na sztywno
  38.     BSC.WCER.BYTE=0x0F;     //odblokuj wait na EEPROM, cs3
  39.    
  40.     PA.DDR=0xFF;            //port A jako wyjscia
  41.     PB.DDR=0xFF;            //port B jako wyjscia
  42.     P8.DDR=0xFF;            //port 8 jako wyjscia
  43.    
  44.     PA.DR.BYTE=0xAA;        //wymus stany początkowe na porcie A
  45.     PB.DR.BYTE=0x55;        //wymus stany początkowe na porcie B
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment