Revision 783

View differences:

branch/faye/sp4c12/SP4c1/SP4c1/SessionM32C_E8a_SYSTEM.ini
24 24
Renesas Communications=USB interface,0,
25 25
[Target]
26 26
M32C E8a SYSTEM=Renesas Communications
27
[USER_DATA]
28
RESET=fe0000
branch/faye/sp4c12/SP4c1/SP4c1/SP4c1.c
8 8
/*  This file is generated by Renesas Project Generator (Ver.4.18).    */
9 9
/*  NOTE:THIS IS A TYPICAL EXAMPLE.                                    */
10 10
/***********************************************************************/
11

  
12 11
#include "sfr32c87.h"
13 12

  
13
void uart0_init(void) ;
14
void uart0_tx(char c);
14 15

  
15
void uart0_init()
16 16

  
17
// initialisation  du port serie
18
 
17
void main()
19 18
{
20
	 registre u0mr
19
	uart0_init();
20
	while(1)
21
	{
21 22
	
23
	uart0_tx('a');
24
	
25
	}
26
	
27
}
28

  
29
void uart0_init(void) 
30
// initialisation du port serie 
31
{
32
	
33
	//registre u0mr
34
	
22 35
	smd0_u0mr = 1;
23 36
	smd1_u0mr = 0;
24 37
	smd2_u0mr = 1;
......
30 43
	
31 44
	u0brg = 64;
32 45
	
46
	// registre u0c0
33 47
	
34

  
48
	clk0_u0c0 = 1;
49
	clk1_u0c0 = 0;
50
	crs_u0c0 = 1;
51
	crd_u0c0 = 1;
52
	nch_u0c0 = 0;
53
	ckpol_u0c0 = 0;
54
	uform_u0c0 = 0;
35 55
	
56
	u0c0 = 0x00;
57
	
58
	// registre u0c1
59
	
60
	te_u0c1 = 1;
61
	re_u0c1 = 1;
62
	u0rrm_u0c1 = 0;
63
	u0lch_u0c1 = 0;
64
	sclkstpb_u0c1 = 0;
65
	
66
	u0c1 = 0x05;
67
	
68
	pd6_3 = 1;
69
	pd6_2 = 0;
70
	
71
	ps0_3 = 1;
72
	ps0_2 = 0;
73
	
74
	
36 75
}
76

  
77
void uart0_tx(char c)	//envoi d'un caractere liaison serie
78
{
79
	while(!ti_u0c1);	//attente liaison
80
	u0tb = c;
81
}

Also available in: Unified diff