Index: branch/FRAISSE/sp4c12/SP4c12.tws
===================================================================
--- branch/FRAISSE/sp4c12/SP4c12.tws	(revision 841)
+++ branch/FRAISSE/sp4c12/SP4c12.tws	(revision 842)
@@ -8,10 +8,14 @@
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
 "D:\FRAISSE\sp4c12\SP4c12\ncrt0.a30" 
+"D:\FRAISSE\sp4c12\SP4c12\sect308.inc" 
+"D:\FRAISSE\sp4c12\SP4c12\sfr32c87.h" 
 "D:\FRAISSE\sp4c12\SP4c12\SP4c12.c" 
 [WORKSPACE_FILE_STATES]
 "D:\FRAISSE\sp4c12\SP4c12\SP4c12.c" -8 -31 1852 796 1 1 
 "D:\FRAISSE\sp4c12\SP4c12\ncrt0.a30" 0 0 1598 519 0 0 
+"D:\FRAISSE\sp4c12\SP4c12\sect308.inc" 78 78 1602 523 0 3 
+"D:\FRAISSE\sp4c12\SP4c12\sfr32c87.h" 52 52 1602 523 0 2 
 [LOADED_PROJECTS]
 "SP4c12" 
 [END]
Index: branch/FRAISSE/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.ini
===================================================================
--- branch/FRAISSE/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.ini	(revision 841)
+++ branch/FRAISSE/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.ini	(revision 842)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=fe0000
+RESET=fe000e
Index: branch/FRAISSE/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.hsf
===================================================================
--- branch/FRAISSE/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.hsf	(revision 841)
+++ branch/FRAISSE/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.hsf	(revision 842)
@@ -47,7 +47,7 @@
 "{55384715-F881-421C-A548-D7D1ABE158E1}PDMRCtrlViews" "0" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_DENORMAL_MODE" "0" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_ROUND_MODE" "0" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_10" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_11" "0000000000000000" 
@@ -54,13 +54,13 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_12" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_13" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_14" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000400" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FE02E7" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFFD00" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000006FC" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000A00" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FE000E" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000C400" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000080" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_21" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_22" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_23" "0000000000000000" 
@@ -77,10 +77,10 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_33" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000FE0000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000020000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000400" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_COUNT" "36" 
@@ -138,7 +138,7 @@
 0 
 [WINDOW_POSITION_STATE_DATA_VD1]
 "Help" "TOOLBAR 0" 59419 1 5 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
-"{WK_00000001_CmdLine}" "WINDOW" 59422 0 1 "0.25" 180 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0" 
+"{WK_00000001_CmdLine}" "WINDOW" 59422 0 1 "0.20" 180 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0" 
 "{WK_00000001_OUTPUT}" "WINDOW" 59422 0 0 "1.00" 180 683 371 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
 "{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 180 683 371 350 200 18 0 "" "0.0" 
 "{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
@@ -165,6 +165,8 @@
 [WINDOW_Z_ORDER]
 "D:\FRAISSE\sp4c12\SP4c12\SP4c12.c" 
 "D:\FRAISSE\sp4c12\SP4c12\ncrt0.a30" 
+"D:\FRAISSE\sp4c12\SP4c12\sect308.inc" 
+"D:\FRAISSE\sp4c12\SP4c12\sfr32c87.h" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
Index: branch/FRAISSE/sp4c12/SP4c12/SP4c12.c
===================================================================
--- branch/FRAISSE/sp4c12/SP4c12/SP4c12.c	(revision 841)
+++ branch/FRAISSE/sp4c12/SP4c12/SP4c12.c	(revision 842)
@@ -9,17 +9,43 @@
 /*  NOTE:THIS IS A TYPICAL EXAMPLE.                                    */
 /***********************************************************************/
 #include "sfr32c87.h"
+#include <math.h>
 
 void uart0_init(void);
 void uart0_tx(char c);
-char uart0_rx(void);
+char uart0_rx();
+void alphabet(void);
+int rectrame(char* buffer);
+int hex2int(char*c);
 
 void main(void)
 {
+	char c = 'A';		//Utilisé pour la fonction alphabet
+	int i=0,j;
+	char table[10][80];
+	char buffer[80];
 	uart0_init();
+		
 	while(1){
-		uart0_tx('o');
-		//uart0_rx();
+		rectrame(buffer);
+		//alphabet();         test alphabet
+		
+		/*					 arrivée d'un caractère sur le port série  
+		uart0_tx(c);
+		uart0_rx();
+		uart0_tx(c+1);
+		*/
+		
+		/*while (i<10){
+			[buffer, j] = rectrame(buffer);
+			if (j==63){
+				for (i;i<j;i++){
+					uart0_tx(buffer[i]);
+				}
+			i++;
+			}
+		}
+		i=0;*/
 	}
 }
 
@@ -72,16 +98,49 @@
 }
 
 void uart0_tx(char c){
-	//Bits TE et RE à 1 (condition pour la transmission et la réception)
-	te_u0c1=1;
-	crd_u0c0=1;
-	crs_u0c0=0;
+	te_u0c1=1; 
+    crd_u0c0=1;
+    crs_u0c0=0;
+	while (ti_u0c1=0); //attente
 	u0tb=c;
-	te_u0c1=0;
 }
 
-//void uart0_rx((void){
-	//while (u0c1_ri=0){
-	//	return u0rb;
-	//}
-//}
\ No newline at end of file
+char uart0_rx(){
+	while (ri_u0c1=0);  //attente
+	return u0rb;
+}
+
+void alphabet(void){
+	char ch='A';
+	int i;
+	for (i=0;i<26;i++){
+		uart0_tx(ch);
+		ch+=1;
+	}
+}
+
+int rectrame(char *buffer){
+	int i=0,cheksum=0;
+	
+	while (uart0_rx()!='$');   //attente d'une trame 
+	while (uart0_rx()!='*'){
+		buffer[i]=uart0_rx();
+		i++;
+	}
+}
+
+int hex2int(char *c){
+	int i;
+	int d;
+	for (i=0;i<2;i++){
+		//Pour des chiffres, la valeur hexadécimal correspond à la valeur décimal
+		if ( (c[i]>'0') && (c[i]<'9')){
+			d += (c[i] - '0')*pow(2,-4*(i-1)); 
+		}
+		//La valeur décimale de A est 10 et au max on aura la lettre F en hexa
+		else if ((c[i]>'A')&&(c[i]<'F')){
+			d += (c[i]-55)*pow(2,-4*(i-1));
+		}
+	}
+	return d;
+}
