Statistics
| Revision:

root / branch / faye / sp4c12 / SP4c1 / SP4c1 / SP4c1.c @ 783

History | View | Annotate | Download (1.58 KB)

1
/***********************************************************************/
2
/*                                                                     */
3
/*  FILE        :SP4c1.c                                               */
4
/*  DATE        :Thu, Jun 03, 2021                                     */
5
/*  DESCRIPTION :main program file.                                    */
6
/*  CPU GROUP   :87B                                                   */
7
/*                                                                     */
8
/*  This file is generated by Renesas Project Generator (Ver.4.18).    */
9
/*  NOTE:THIS IS A TYPICAL EXAMPLE.                                    */
10
/***********************************************************************/
11
#include "sfr32c87.h"
12

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

    
16

    
17
void main()
18
{
19
        uart0_init();
20
        while(1)
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
        
35
        smd0_u0mr = 1;
36
        smd1_u0mr = 0;
37
        smd2_u0mr = 1;
38
        ckdir_u0mr = 0;
39
        stps_u0mr = 0;
40
        prye_u0mr = 0;
41
        iopol_u0mr = 0;
42
        u0mr = 0x05;
43
        
44
        u0brg = 64;
45
        
46
        // registre u0c0
47
        
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;
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
        
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
}