Index: branch/best/sp4c12/SP4b1/SP4b1/SessionM32C_E8a_SYSTEM.ini
===================================================================
--- branch/best/sp4c12/SP4b1/SP4b1/SessionM32C_E8a_SYSTEM.ini	(revision 850)
+++ branch/best/sp4c12/SP4b1/SP4b1/SessionM32C_E8a_SYSTEM.ini	(revision 851)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=fe0000
+RESET=fe0002
Index: branch/best/sp4c12/SP4b1/SP4b1/SessionM32C_E8a_SYSTEM.hsf
===================================================================
--- branch/best/sp4c12/SP4b1/SP4b1/SessionM32C_E8a_SYSTEM.hsf	(revision 850)
+++ branch/best/sp4c12/SP4b1/SP4b1/SessionM32C_E8a_SYSTEM.hsf	(revision 851)
@@ -45,20 +45,20 @@
 "{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" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "000000000000000A" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "000000000000000A" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_10" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_11" "0000000000000000" 
 "{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" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FE0000" 
-"{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_15" "0000000000000400" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FE034A" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFFD00" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000686" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000A02" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "000000000000008C" 
 "{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" 
@@ -75,10 +75,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" "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" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "00000000000006AA" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000020000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000069A" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000400" 
 "{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" 
@@ -102,8 +102,39 @@
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_SAMPLEING_RATE" "1000" 
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_VIEW" "0,0,0,0,0,0" 
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ImageCtrlViews" "0" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchCtrlViews" "0" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchCtrlViews" "4" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth0" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth1" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth12" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth2" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth3" "200" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "checksum, 10, 0, P, Col, Hex, N" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "i, 10, 0, P, Col, Hex, N" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "trame_ok, 1, 0, P, Col, Hex, MN" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "3" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth2" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth3" "200" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ECX_WATCH_ITEMCnt" "0" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd2ColWidth0" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd2ColWidth1" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd2ColWidth12" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd2ColWidth2" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd2ColWidth3" "200" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd2ECX_WATCH_ITEMCnt" "0" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd3ColWidth0" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd3ColWidth1" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd3ColWidth12" "150" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd3ColWidth2" "120" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd3ColWidth3" "200" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd3ECX_WATCH_ITEMCnt" "0" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndInitial_Radix" "0" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndInstanceKey0" "{WK_00000001_WATCH}SP4b1SessionM32C_E8a_SYSTEM" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndRecentFile_WatchRecord" "" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndRecentFile_WatchSave" "" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndUpdate_Interval" "100" 
@@ -136,7 +167,8 @@
 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_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_00000001_OUTPUT}" "WINDOW" 59422 0 0 "0.61" 180 683 371 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
+"{WK_00000001_WATCH}SP4b1SessionM32C_E8a_SYSTEM" "WINDOW" 59422 0 1 "0.39" 180 0 0 350 200 18 0 "32781|32783|<<separator>>|32771|32829|32772|32827|32773|<<separator>>|32786|<<separator>>|32810|32811|32831" "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" 
 "{WK_TB00000002_EDITOR}" "TOOLBAR 0" 59419 0 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
Index: branch/best/sp4c12/SP4b1/SP4b1/SP4b1.c
===================================================================
--- branch/best/sp4c12/SP4b1/SP4b1/SP4b1.c	(revision 850)
+++ branch/best/sp4c12/SP4b1/SP4b1/SP4b1.c	(revision 851)
@@ -13,13 +13,15 @@
 void uart0_init(void); // Initialisation du port série
 void uart0_tx(char c); //Envoie d'un caractère
 char uart0_rx(void); //Fonction d'attente et lecture d'un caractère
-int rectrame(char * Buffer);
+int rectramev1(char * Buffer);
+int rectramev2(char * Buffer);
+void irectramev1(char * Buffer);
 int hex2int(char *c); //Passage hexa en int
 
 /*Variable Globale*/
 int trame_ok;
+int Etat = 0; //0->synchronisation, 1->reception, 2->checksum, 3->validation
 
-
 void main(void)
 {
 	char Buffer[80];
@@ -26,12 +28,15 @@
 	
 	uart0_init();
 	while(1){
-		uart0_tx(rectrame(Buffer)+48);
+		uart0_tx(rectramev1(Buffer)+48);
 		if (trame_ok == 1){
 			uart0_tx('O');
+			uart0_tx('K');
 		}
 		else{
 			uart0_tx('N');
+			uart0_tx('O');
+			uart0_tx('N');
 		}
 	}
 }
@@ -60,7 +65,7 @@
 	return u0rb;	
 }
 
-int rectrame(char * Buffer){
+int rectramev1(char * Buffer){
 	int i;
 	char checksum;
 	char carac_recu;
@@ -88,6 +93,61 @@
 	return i;
 }
 
+/*int rectramev2(char * Buffer){
+	int i;
+	char c;
+	while(1){
+		c = u0rb;
+		if (c == '&'){
+			
+		}
+	}
+	
+	return i;
+}*/
+
+void irectramev1(char * Buffer){
+	int i;
+	char c;
+	char checksum_trame;
+	while(1){
+		
+		c = uart0_rx();
+		switch(Etat){
+			
+			case 0 : //Synchro
+				
+				if (c == '$'){
+					
+					i = 0;
+					checksum_trame = 0;
+					Etat = 1;
+				}
+			
+			case 1 : //Reception
+				
+				if (c != '*'){
+				
+					Buffer[i++] = c;
+					checksum_trame ^= c;
+						
+				}
+				else{
+				
+					Etat = 2;	
+				}
+				
+			case 2 : //checksum
+				
+					
+			
+			
+			
+		}
+		
+	}
+}
+
 int hex2int(char *c)
 {
 	int i=0;
@@ -106,3 +166,91 @@
 	}
 	return(c[1]+16*c[0]);
 }
+/*
+typedef enum{synchronisation , reception , checksum , validation}etat_machine;
+etat_machine etat=synchronisation;
+
+
+int RecTrame(char*Buffer)
+{
+	//declaration des variables
+	int nombre_caractere_apres_etoile=0;
+	int k=0; //pour le test
+	int nombre_cararactere=0;
+	char caractere_recu;
+	char checksum_trame=0;
+	char checksum_fin_trame[3];
+	char checksum_calculer=0;
+
+	while(1)
+	{
+		//caractere_recu = uart0_rx();
+		caractere_recu = trame1[k];
+		k++;
+
+		switch(etat)
+		{
+			case synchronisation :
+					if(caractere_recu == '$')
+					{
+						nombre_cararactere = 0;
+						etat=reception;
+						checksum_trame = 0;
+					}
+					break;
+
+			case reception :
+				if(caractere_recu != '*')
+				{
+				    //placement du caractere recu de la trame dans le Buffer
+					Buffer[nombre_cararactere] = caractere_recu;
+					nombre_cararactere++;
+				//verification du checksum à chaque caractere recu
+					checksum_trame ^= caractere_recu;
+					nombre_caractere_apres_etoile = 0;
+				}
+				else
+				{
+				    //passage à l'etat cheksum quand la trame est memorisée
+					etat = checksum;
+				}
+				break;
+
+			case checksum :
+		                            //récupération du checksum de la trame (2derniers caractères)
+			checksum_fin_trame[nombre_caractere_apres_etoile] = caractere_recu;
+
+                            			//attention, on mémorise deux caractères
+		                                donc, premier caractère -> nombre_caractere_apres_etoile=0
+                             		              deuxième caractère -> nombre_caractere_apres_etoile=1
+		                                soit deux caractères mémorisés après la virgule
+
+				if(nombre_caractere_apres_etoile == 2)
+				{
+					    etat = validation;
+					checksum_calculer = hex_int(checksum_fin_trame);
+				}
+
+				nombre_caractere_apres_etoile++;
+				break;
+
+			case validation :
+		                            //comparaison du checksum_trame et checksum_calculer
+                            				si l'égalité est vérifiée alors on retourne le nombre
+		                            de caractère de la trame, sinon on retourne la valeur 0
+
+				if(checksum_trame == checksum_calculer)
+				{
+					etat = synchronisation;
+					return nombre_cararactere;
+				}
+				else
+				{
+					etat = synchronisation;
+					return 0;
+				}
+				break;
+		}
+	}
+}
+*/
\ No newline at end of file
