Technical information
SCI to SPI Peripheral Communication in V850ES Microcontrollers
PDH0 1-A R1.17 - R2.17 SB35
PDH1 1-B R1.18 - R2.18 SB36
PDH2 1-C R1.19 - R2.19 SB37
PDH3 1-D R1.20 - R2.20 SB38
PDH4 1-E R1.21 - R2.21 SB39
PDH5 1-F R1.22 - R2.22 SB40
PDH6 1-G R1.23 - R2.23 SB41
PDH7 1-DP R1.24 - R2.24 SB42
*/
/* NOTE: on M-Station Base V1.0 prototype, PDH0-PDH7 are */
/* located at ROW4.1-8, and need to be wirewrapped to */
/* connect to ROW2.17-24 to drive LED1. */
/* need pragma declaration to access SFR's in C */
#pragma ioreg
#include "led_vkj1.h"
/* table of bit patterns for seven-segment digits */
static unsigned char dig_tab[] = {
LED_PAT_0, /* 0 */
LED_PAT_1, /* 1 */
LED_PAT_2, /* 2 */
LED_PAT_3, /* 3 */
LED_PAT_4, /* 4 */
LED_PAT_5, /* 5 */
LED_PAT_6, /* 6 */
LED_PAT_7, /* 7 */
LED_PAT_8, /* 8 */
LED_PAT_9, /* 9 */
LED_PAT_A, /* A */
LED_PAT_B, /* B */
LED_PAT_C, /* C */
LED_PAT_D, /* D */
LED_PAT_E, /* E */
LED_PAT_F /* F */
};
/* void led_init(void) */
/* set up ports for display of LED digits */
void led_init(void)
{
#if 0 /* ports initialized in Port_Init() by Applilet */
PMCDH = 0x00; /* set port DH to port mode */
PMDH = 0x00; /* set port DH to output */
PMCDLH = 0x00; /* set port DL high 8-bits to port mode */
PMDLH = 0x00; /* set port DL high 8-bits to output */
#endif
}
/* void led_out_right(unsigned char val) */
/* output raw data to right LED */
75