|
/***********************************************************************/
|
|
/* */
|
|
/* FILE :Sp4c1.c */
|
|
/* DATE :Wed, Jun 02, 2021 */
|
|
/* DESCRIPTION :main program file. */
|
|
/* CPU GROUP :87B */
|
|
/* */
|
|
/* This file is generated by Renesas Project Generator (Ver.4.18). */
|
|
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
|
|
/***********************************************************************/
|
|
#include "sfr32c87.h"
|
|
|
|
void uart0_init(void)
|
|
{
|
|
u0mr = 0x05;
|
|
u0brg = 0x20;
|
|
u0c0 = 0x11;
|
|
u0c1 = 0x05;
|
|
pd6_0 = 0;
|
|
pd6_1 = 0;
|
|
pd6_2 = 0;
|
|
pd6_3 = 1;
|
|
ps0 = 0x08;
|
|
}
|
|
|
|
void uart0_tx(char c)
|
|
{
|
|
while(ti_u0c1!=1);
|
|
u0tb=c;
|
|
}
|
|
char uart0_rx()
|
|
{
|
|
while(ri_u0c1!=1);
|
|
return u0rb;
|
|
}
|
|
|
|
void main (void) {
|
|
|
|
int etat=0;
|
|
uart0_init();
|
|
pd1=0xff;
|
|
|
|
if((uart0_rx())=='$'){
|
|
p1=0xff;
|
|
|
|
if((uart0_rx())=='*'){
|
|
p1=0x0f;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
/*char c='A';
|
|
int i;
|
|
uart0_init();
|
|
|
|
while(1){
|
|
i=0;
|
|
while (i<26){
|
|
uart0_tx(c+i);
|
|
i++;
|
|
}
|
|
}
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|