Download Print this page

Renesas REJ06B0734-0100 Application Note page 12

Data transfer to on-chip peripheral modules with dmac

Advertisement

2. Sample Program Listing "main.c" (2)
54 /* ---- Values for baud rate specification ---- */
55
enum{
56
CBR_1200,
57
CBR_2400,
58
CBR_4800,
59
CBR_9600,
60
CBR_19200,
61
CBR_31250,
62
CBR_38400,
63
CBR_57600,
64
CBR_115200
65
};
66
67 /* ==== Table of register setting values ==== */
68
static SH7203_BAUD_SET scif_baud[] = {
69
{214, 1},
70
{106, 1},
71
{214, 0},
72
{106, 0},
73
{ 53, 0},
74
{ 32, 0},
75
{ 26, 0},
76
{ 17, 0},
77
{
8, 0}
78
};
79
/* Character string to be transmitted */
80
const signed char data[] = "SCIF request DMAC Sample Software SH7203.¥r¥n";
81
82
/*""FUNC COMMENT""*******************************************************
83
* Outline
84
*-----------------------------------------------------------------------
85
* Include
86
*-----------------------------------------------------------------------
87
* Declaration
88
*-----------------------------------------------------------------------
89
* Function
90
*
91
*
92
*-----------------------------------------------------------------------
93
* Argument
94
*-----------------------------------------------------------------------
95
* Return Value
96
*-----------------------------------------------------------------------
97
* Notice
98
*""FUNC COMMENT END""***************************************************/
99
void main(void)
100 {
101
/* ==== Enabling DMAC initialization/transfer ==== */
102
io_init_dma1(data, (void *)&SCIF0.SCFTDR.BYTE ,sizeof(data),
103
104
105
106
REJ06B0734-0101/Rev.1.01
Data Transfer to On-chip Peripheral Modules with DMAC
/*
1200bps (-0.07%) */
/*
2400bps ( 0.39%) */
/*
4800bps (-0.07%) */
/*
9600bps ( 0.39%) */
/* 19200bps (-0.54%) */
/* 31250bps ( 0.00%) */
/* 38400bps (-0.54%) */
/* 57600bps (-0.54%) */
/*115200bps (-0.54%) */
: Sample Program Main (UART transmission with use of DMAC)
: #include <string.h>
: void main(void);
: The character string data stored in external memory is DMA transferred
: to the SCIF transmit FIFO data register. The DMAC is activated
: by an SCIF transmit interrupt request.
: void
: void
:
DMA_SIZE_BYTE | DMA_INT_DISABLE);
/* On-chip peripheral module request (SCIF transmit interrupt request) */
/* Data transfer from external memory to SCIF transmit */
/* Data transfer to data registers */
December 2008
SH7263/SH7203 Group
Page 10 of 17

Advertisement

loading

This manual is also suitable for:

Sh7263Sh7203