Index: branch/bouillot/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.hsf
===================================================================
--- branch/bouillot/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.hsf	(revision 878)
+++ branch/bouillot/sp4c12/SP4c12/SessionM32C_E8a_SYSTEM.hsf	(revision 879)
@@ -45,7 +45,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" "0000000000000041" 
+"{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" 
@@ -53,12 +53,12 @@
 "{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" "0000000000FE033C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FE0301" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFFD00" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000714" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000A18" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "000000000000076C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000A6C" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000081" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000088" 
 "{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" 
@@ -91,7 +91,23 @@
 "{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_COMB_BUFFER" ",,,," 
 "{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_SAMPLING_RATE" "1000" 
 "{8A898260-6F1D-11D5-8EB6-00004CC34E9D}WaveformCtrlViews" "0" 
-"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersCtrlViews" "0" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersCtrlViews" "1" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0ColumnWidth" "51,64,37" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0ECX_REGISTER_COUNT" "36" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0ECX_REGISTER_DISPLAYED" "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0HideFLAGs" "0" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0HideRadix" "0" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0LastFileName" "" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0RadixList" "16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,2,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16," 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndInstanceKey0" "{WK_00000001_REGISTERS}SP4c12SessionM32C_E8a_SYSTEM" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewB0ColumnWidth" "51,64,37" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewB0ECX_REGISTER_COUNT" "36" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewB0ECX_REGISTER_DISPLAYED" "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewB0HideFLAGs" "0" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewB0HideRadix" "0" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewB0LastFileName" "" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewB0RadixList" "16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,2,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16," 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWndViewBInstanceKey0" "{WK_00000001_REGISTERS}SP4c12SessionM32C_E8a_SYSTEMViewB" 
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_ADDRESS_NAME" "" 
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_BUFFER" "00000000,00000000,0,0" 
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_COLOR" "0,0,0,0" 
@@ -102,8 +118,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" "valeur, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Global," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "nb_caractere, 1, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "trame, 6, 0, P, Col, Hex, MA" 
+"{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}SP4c12SessionM32C_E8a_SYSTEM" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndRecentFile_WatchRecord" "" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndRecentFile_WatchSave" "" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndUpdate_Interval" "100" 
@@ -529,7 +576,7 @@
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp456" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp457" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp458" "1" 
-"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp459" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp459" "1" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp46" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp460" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp461" "0" 
@@ -628,7 +675,12 @@
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp545" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp546" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp547" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp548" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp549" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp55" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp550" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp551" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp552" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp56" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp57" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp58" "0" 
@@ -678,7 +730,7 @@
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp98" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0Exp99" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0ScrollHorz" "0" 
-"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0ScrollVert" "225" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd0ScrollVert" "458" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1ColWidth0" "200" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1ColWidth1" "100" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1ColWidth2" "100" 
@@ -697,8 +749,10 @@
 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_IO}SP4c12SessionM32C_E8a_SYSTEM" "WINDOW" 59422 0 1 "0.37" 180 0 0 350 200 18 0 "32817|32826|32819|32820|32821" "0.0" 
-"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 0 "0.63" 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_IO}SP4c12SessionM32C_E8a_SYSTEM" "WINDOW" 59422 0 2 "0.20" 180 0 0 350 200 18 0 "32817|32826|32819|32820|32821" "0.0" 
+"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 1 "0.46" 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_REGISTERS}SP4c12SessionM32C_E8a_SYSTEM" "WINDOW" 59421 0 0 "1.00" 180 0 0 350 200 18 0 "" "0.0" 
+"{WK_00000001_WATCH}SP4c12SessionM32C_E8a_SYSTEM" "WINDOW" 59422 0 0 "0.35" 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" 
@@ -722,8 +776,12 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"D:\tp_sp4_2021_bouillot\sp4c12\SP4c12\rectrame.c" 
 "D:\tp_sp4_2021_bouillot\sp4c12\SP4c12\SP4c12.c" 
 "D:\tp_sp4_2021_bouillot\sp4c12\SP4c12\ncrt0.a30" 
+"D:\tp_sp4_2021_bouillot\sp4c12\SP4c12\uart0_rx.c" 
+"D:\tp_sp4_2021_bouillot\sp4c12\SP4c12\uart0_init.c" 
+"D:\tp_sp4_2021_bouillot\sp4c12\SP4c12\uart0_tx.c" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
Index: branch/bouillot/sp4c12/SP4c12/SP4c12.c
===================================================================
--- branch/bouillot/sp4c12/SP4c12/SP4c12.c	(revision 878)
+++ branch/bouillot/sp4c12/SP4c12/SP4c12.c	(revision 879)
@@ -11,7 +11,6 @@
 #include "sfr32c87.h"
 #include "uart0_tx.c"
 #include "uart0_rx.c"
-#include "rectrame.c"
 #include "uart0_init.c"
 	
 
@@ -23,13 +22,43 @@
 
 char valeur ;
 int nb_caractere ;
-char trame[80];
+char trame[70];
+int checksum_calcul;
 
+
+
+int rectrame (char * Buffer){
+	int i = 0;
+	int debut=0, fin=0;
+	
+	
+	//lecture du caractère reçu
+	if (uart0_rx() == '$'){	
+		*(Buffer+i)=uart0_rx();
+		do
+		{
+			i++;
+			*(Buffer+i) = uart0_rx();
+			if (*(Buffer+i)!='*')
+			{
+				checksum_calcul = checksum_calcul ^ *(Buffer+i);
+			}	
+		}while(*(Buffer+i)!='*');
+	}
+
+	
+//	if (*(Buffer) == '$'){
+//		fflush (Buffer);
+//	}*/
+	return (i+1);
+	
+}
+
 void main (void){
 	uart0_init();
-		if (valeur == '$'){
-			nb_caractere = rectrame(trame);
-		}
+	while (1){
+		rectrame (trame);
+	}
 }
 
 //programme permettant de lire ce que l'on reçoit sur le port série et d'allumer des leds en conséquence
