Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************************
- KPIT Cummins Infosystems Ltd, Pune, India. - 10-Mar-2003.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *****************************************************************/
- /*************************************************************************
- Hardware initialisation routine called by the startup code before the
- sections are initialised. Bus controller, and other essential hardware
- setup code should be placed here.
- ***************************************************************************/
- #define LIMIT 20000
- #include "iodefine.h"
- void hw_initialise (void)
- {
- // init timer
- ITU0.TIER.BYTE=0xF8;
- ITU0.TCR.BYTE=0xA3;
- ITU0.TIOR.BYTE=0x88;
- ITU0.TSR.BYTE=0xF8;
- ITU0.GRA = LIMIT;
- ITU.TSTR.BYTE = 0xE1;
- // init A/C
- AD.ADCSR.BYTE = 0x3A; // Powinna dzałać a nie chce
- // TODO: add hardware initialisation code here
- BSC.ABWCR.BYTE=0xFB; //ustaw szerokosc szyny danych dla poszczegolnych obszarow
- BSC.ASTCR.BYTE=0x0F; //ustaw 3 stanowy cykl na szynie, cs6-2stanowy
- BSC.WCR.BYTE=0xF3; //ustaw 3 wait-y na sztywno
- BSC.WCER.BYTE=0x0F; //odblokuj wait na EEPROM, cs3
- PA.DDR=0xFF; //port A jako wyjscia
- PB.DDR=0xFF; //port B jako wyjscia
- P8.DDR=0xFF; //port 8 jako wyjscia
- PA.DR.BYTE=0xAA; //wymus stany początkowe na porcie A
- PB.DR.BYTE=0x55; //wymus stany początkowe na porcie B
- }
Advertisement
Add Comment
Please, Sign In to add comment