Projet

Général

Profil

718 mafall7
/***********************************************************************/
/* */
/* FILE :uart0.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. */
/***********************************************************************/
725 mafall7
#include "sfr32c87.h"
718 mafall7
725 mafall7
801 mafall7
void uart0_init (void)
{
u0mr = 0x05;
u0brg = 0x20;
u0c0 = 0x11;
u0c1 = 0x05;
725 mafall7
801 mafall7
pd6_1 = 0 ; /*uniquement le bit ? utiliser et on garde la configuration qu'on a trouv? dans le UART1 c'est ? dire le poids fort*/
pd6_2 = 0;
pd6_3 = 1;
ps0_1 = 0;
ps0_2 = 0;
ps0_3 = 1;

}

void uart0_tx(char c)
{
while(ti_u0c1 !=1);
u0tb=c;
}

char uart0_rx()
{
while(ri_u0c1!=1);
return u0rb;
}
725 mafall7
801 mafall7
void main(void)
725 mafall7
{


801 mafall7
char s='A';
uart0_init();
while(1)
{
int i=0;
{
for (i=0;i<26;i++)
uart0_tx(s+i);
}

}
}