home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / HITECH-C / Z8051H83.EXE / H83.H < prev    next >
Text File  |  1993-05-21  |  9KB  |  232 lines

  1. /*
  2.  *    Register definitions for H8/330
  3.  *
  4.  *    Copyright (C) 1992 HI-TECH Software
  5.  */
  6.  
  7. #define    PORT    static unsigned
  8.  
  9. /*    Free Running Timer section */
  10.  
  11. PORT char    FRT_TIER @0xFF90;        /* Timer Interrupt Enable Register */
  12.  
  13. #define    ICIAE    0x80                /* Input Capture Interrupt A Enable */
  14. #define    ICIBE    0x40                /* Input Capture Interrupt B Enable */
  15. #define    ICICE    0x20                /* Input Capture Interrupt C Enable */
  16. #define    ICIDE    0x10                /* Input Capture Interrupt D Enable */
  17. #define    OCIAE    0x08                /* Output Compare Interrupt A Enable */
  18. #define    OCIBE    0x04                /* Output Compare Interrupt B Enable */
  19. #define    FOVIE    0x02                /* Overflow Interrupt Enable */
  20.  
  21. PORT char    FRT_TCSR @0xFF91;        /* Timer Control/Status Register */
  22.  
  23. #define    ICFA    0x80                /* Input Capture Flag A */
  24. #define    ICFB    0x40                /* Input Capture Flag B */
  25. #define    ICFC    0x20                /* Input Capture Flag C */
  26. #define    ICFD    0x10                /* Input Capture Flag D */
  27. #define    OCFA    0x08                /* Output Compare Flag A */
  28. #define    OCFB    0x04                /* Output Compare Flag B */
  29. #define    OVF    0x02                /* Overflow flag */
  30. #define    CCLRA    0x01                /* Counter Clear A */
  31.  
  32. PORT short    FRT_FRC @0xFF92;        /* Free Running Counter */
  33. PORT short    FRT_OCRA @ 0xFF94;        /* Output Compare Register A */
  34. PORT short    FRT_OCRB @ 0xFF94;        /* Output Compare Register B */
  35. PORT char    FRT_TCR @ 0xFF96;        /* Timer Control Register */
  36.  
  37. #define    IEDGA    0x80                /* Input Edge Select A */
  38. #define    IEDGB    0x40                /* Input Edge Select B */
  39. #define    IEDGC    0x20                /* Input Edge Select C */
  40. #define    IEDGD    0x10                /* Input Edge Select D */
  41. #define    BUFEA    0x08                /* Buffer Enable A */
  42. #define    BUFEB    0x04                /* Buffer Enable B */
  43. #define    CKS1    0x02                /* Clock Select 1 */
  44. #define    CKS0    0x01                /* Clock Select 0 */
  45.  
  46. PORT char    FRT_TOCR @ 0xFF97;        /* Timer Output Control Register */
  47.  
  48. #define    OCRS    0x10                /* Output Compare Register Select */
  49. #define    OEA    0x08                /* Output Enable A */
  50. #define    OEB    0x04                /* Output Enable B */
  51. #define    OLVLA    0x02                /* Output Level A */
  52. #define    OLVLB    0x01                /* Output Level B */
  53.  
  54. PORT short    FRT_ICRA @ 0xFF98;        /* Input Capture Register A */
  55. PORT short    FRT_ICRB @ 0xFF9A;        /* Input Capture Register B */
  56. PORT short    FRT_ICRC @ 0xFF9C;        /* Input Capture Register C */
  57. PORT short    FRT_ICRD @ 0xFF9E;        /* Input Capture Register D */
  58.  
  59. /*    Pulse Width Modulation 0 */
  60.  
  61. PORT char    PWM0_TCR @ 0xFFA0;        /* Timer Control Register */
  62.  
  63. #define    OE    0x80                /* Output Enable */
  64. #define    OS    0x40                /* Output Select */
  65. #define    CKS2    0x04                /* Clock Select 2 */
  66. #define    CKS1    0x02                /* Clock Select 1 */
  67. #define    CKS0    0x01                /* Clock Select 0 */
  68.  
  69. PORT char    PWM0_DTR @ 0xFFA1;        /* DuTy Register */
  70. PORT char    PWM0_TCNT @ 0xFFA2;        /* Timer Counter */
  71.  
  72. /*    Pulse Width Modulation 1 */
  73.  
  74. PORT char    PWM1_TCR @ 0xFFA4;        /* Timer Control Register */
  75. PORT char    PWM1_DTR @ 0xFFA5;        /* DuTy Register */
  76. PORT char    PWM1_TCNT @ 0xFFA6;        /* Timer Counter */
  77.  
  78. /*    Ports */
  79.  
  80. PORT char    P1DDR    @0xFFB0;        /* Port 1 Data Direction */
  81. PORT char    P1DR    @0xFFB2;        /* Port 1 Data Register */
  82. PORT char    P2DDR    @0xFFB1;        /* Port 2 Data Direction */
  83. PORT char    P2DR    @0xFFB3;        /* Port 2 Data Register */
  84. PORT char    P3DDR    @0xFFB4;        /* Port 3 Data Direction */
  85. PORT char    P3DR    @0xFFB6;        /* Port 3 Data Register */
  86. PORT char    P4DDR    @0xFFB5;        /* Port 4 Data Direction */
  87. PORT char    P4DR    @0xFFB7;        /* Port 4 Data Register */
  88. PORT char    P5DDR    @0xFFB8;        /* Port 5 Data Direction */
  89. PORT char    P5DR    @0xFFBA;        /* Port 5 Data Register */
  90. PORT char    P6DDR    @0xFFB9;        /* Port 6 Data Direction */
  91. PORT char    P6DR    @0xFFBB;        /* Port 6 Data Register */
  92. PORT char    P7DR    @0xFFBE;        /* Port 7 Data Register */
  93. PORT char    P8DDR    @0xFFBD;        /* Port 8 Data Direction */
  94. PORT char    P8DR    @0xFFBF;        /* Port 8 Data Register */
  95. PORT char    P9DDR    @0xFFC0;        /* Port 9 Data Direction */
  96. PORT char    P9DR    @0xFFC1;        /* Port 9 Data Register */
  97.  
  98. PORT char    SYSCR    @0xFFC4;        /* System control register */
  99.  
  100. #define    SSBY    0x80                /* Software Standby */
  101. #define    STS2    0x40                /* Standby Timer Select 2 */
  102. #define    STS1    0x20                /* Standby Timer Select 1 */
  103. #define    STS0    0x10                /* Standby Timer Select 0 */
  104. #define    NMIEG    0x04                /* NMI Edge select */
  105. #define    DPME    0x02                /* Dual Port Ram Enable */
  106. #define    RAME    0x01                /* on-chip Ram Enable */
  107.  
  108. PORT char    MDCR    @0xFFC5;        /* Mode Control Register */
  109. PORT char    ISCR    @0xFFC6;        /* IRQ Sense Control Register */
  110. PORT char    IER    @0xFFC7;        /* IRQ Enable Register */
  111.  
  112. /*    Timer 0 */
  113.  
  114. PORT char    TMR0_TCR    @ 0xFFC8;    /* Timer control register */
  115.  
  116. #define    CMIEB    0x80                /* Compare Match Interrupt Enable B */
  117. #define    CMIEA    0x40                /* Compare Match Interrupt Enable A */
  118. #define    OVIE    0x20                /* Overlow interrupt Enable */
  119. #define    CCLR1    0x10                /* Counter Clear 1 */
  120. #define    CCLR0    0x08                /* Counter Clear 0 */
  121. #define    CKS2    0x04                /* Clock Select 2 */
  122. #define    CKS1    0x02                /* Clock Select 1 */
  123. #define    CKS0    0x01                /* Clock Select 0 */
  124.  
  125. PORT char    TMR0_TCSR    @ 0xFFC9;    /* Timer Control/Status Register */
  126.  
  127. #define    CMFB    0x80                /* Compare Match Flag B */
  128. #define    CMFA    0x40                /* Compare Match Flag A */
  129. #define    TOVF    0x20                /* Timer Overflow Flag */
  130. #define    OS3    0x08                /* Output Select 3 */
  131. #define    OS2    0x04                /* Output Select 2 */
  132. #define    OS1    0x02                /* Output Select 1 */
  133. #define    OS0    0x01                /* Output Select 0 */
  134.  
  135. PORT char    TMR0_TCORA    @ 0xFFCA;    /* Time Constant Register A */
  136. PORT char    TMR0_TCORB     @ 0xFFCB;    /* Time Constant Register B */
  137. PORT char    TMR0_TCNT    @ 0xFFCC;    /* Timer Counter */
  138.  
  139. /*    Timer 1 */
  140.  
  141. PORT char    TMR1_TCR    @ 0xFFD0;    /* Timer control register */
  142. PORT char    TMR1_TCSR    @ 0xFFD1;    /* Timer Control/Status Register */
  143. PORT char    TMR1_TCORA    @ 0xFFD2;    /* Time Constant Register A */
  144. PORT char    TMR1_TCORB    @ 0xFFD3;    /* Time Constant Register B */
  145. PORT char    TMR1_TCNT    @ 0xFFD4;    /* Timer Counter */
  146.  
  147. /*    Serial Communications Interface */
  148.  
  149. PORT char    SMR        @ 0xFFD8;    /* Serial Mode Register */
  150.  
  151. #define    SYNCH    0x80                /* Synchronous mode */
  152. #define    CHR    0x40                /* 7 bit data select */
  153. #define    PE    0x20                /* Parity Enable */
  154. #define    EP    0x10                /* Even Parity */
  155. #define    STOP2    0x08                /* select 2 STOP bits */
  156. #define    CKS1    0x02                /* Clock Select 1 */
  157. #define    CKS0    0x01                /* Clock Select 0 */
  158.  
  159. PORT char    BRR        @ 0xFFD9;    /* Baud Rate Register */
  160. PORT char    SCR        @ 0xFFDA;    /* Serial Control Register */
  161.  
  162. #define    TIE    0x80                /* Transmit Interrupt Enable */
  163. #define    RIE    0x40                /* Receive Interrupt Enable */
  164. #define    TE    0x20                /* Transmit Enable */
  165. #define    RE    0x10                /* Receive Enable */
  166. #define    CKE1    0x02                /* Clock Enable 1 */
  167. #define    CKE0    0x01                /* Clock Enable 0 */
  168.  
  169. PORT char    TDR        @ 0xFFDB;    /* Transmit Data Register */
  170. PORT char    SSR        @ 0xFFDC;    /* Serial Status Register */
  171.  
  172. #define    TDRE    0x80                /* Transmit Data Register Empty */
  173. #define    RDRF    0x40                /* Receive Data Register Full */
  174. #define    ORER    0x20                /* Overrun Error */
  175. #define    FER    0x10                /* Framing Error */
  176. #define    PER    0x08                /* Parity Error */
  177.  
  178. PORT char    RDR        @ 0xFFDD;    /* Receive Data Register */
  179.  
  180. /*    Analog to Digital Converter */
  181.  
  182. static struct
  183. {
  184.     unsigned char    data;            /* A/D Converter data */
  185.     unsigned char    _rubbish;        /* fill byte */
  186. }        ADDR[4]        @ 0xFFE0;
  187. PORT char    ADCSR        @ 0xFFE8;    /* A/D Control Status Register */
  188.  
  189. #define    ADF    0x80                /* AD End Flag */
  190. #define    ADIE    0x40                /* AD interrupt Enable */
  191. #define    ADST    0x20                /* AD Start */
  192. #define    SCAN    0x10                /* Scan mode */
  193. #define    CKS    0x08                /* Clock Select */
  194.  
  195. PORT char    ADCR        @ 0xFFEA;    /* A/D Control Register */
  196.  
  197. #define    TGRE    0x80                /* Trigger Enable */
  198.  
  199. /*    DPRAM */
  200.  
  201. PORT char    PCCSR        @ 0xFFF0;    /* Parallel Communication Contro/Status Register */
  202. PORT char    PCDR0A        @ 0xFFF1;    /* Par. Com. Data Register A */
  203. PORT char    PCDR0B        @ 0xFFF1;    /* Par. Com. Data Register B */
  204. PORT char    PCDR[14]    @ 0xFFF2;    /* Par. Com. data 0-13 */
  205.  
  206.  
  207. /*
  208.  *    Interrupt vectors
  209.  */
  210.  
  211. #define    NMI        0x06            /* Non-Maskable-Interrupt */
  212. #define    IRQ(x)        ((x)*2+8)        /* External interrupts */
  213. #define    ICIA        0x18            /* Input Capture Interrupt A */
  214. #define    ICIB        0x1A            /* Input Capture Interrupt B */
  215. #define    ICIC        0x1C            /* Input Capture Interrupt C */
  216. #define    ICID        0x1E            /* Input Capture Interrupt D */
  217. #define    OCIA        0x20            /* Output Compare Interrupt A */
  218. #define    OCIB        0x22            /* Output Compare Interrupt B */
  219. #define    FOVI        0x24            /* Overflow Interrupt */
  220. #define    CMI0A        0x26            /* Compare-Match 0 A */
  221. #define    CMI0B        0x28            /* Compare-Match 0 B */
  222. #define    OVI0        0x2A            /* Overflow 0 */
  223. #define    CMI1A        0x2C            /* Compare-Match 1 A */
  224. #define    CMI1B        0x2E            /* Compare-Match 1 B */
  225. #define    OVI1        0x30            /* Overflow 1 */
  226. #define    MREI        0x32            /* Master Read End Interrupt */
  227. #define    MWEI        0x34            /* Master Write End */
  228. #define    ERI        0x36            /* Error Interrupt */
  229. #define    RXI        0x38            /* Receiver Interrupt */
  230. #define    TXI        0x3A            /* Transmitter Interrupt */
  231. #define    ADI        0x3C            /* A/D Interrupt */
  232.