Index: branch/KANAAN/sp4b1/SP4b1/SessionM32C_E8a_SYSTEM.hsf
===================================================================
--- branch/KANAAN/sp4b1/SP4b1/SessionM32C_E8a_SYSTEM.hsf	(revision 891)
+++ branch/KANAAN/sp4b1/SP4b1/SessionM32C_E8a_SYSTEM.hsf	(revision 892)
@@ -8,7 +8,7 @@
 "" 
 [GENERAL_DATA]
 "FIRST_CONNECTION_TAG" "NO" 
-"MRULABELS_DATAMANAGER_KEY" "FE02FE|FE02F7|FE0000|FE030C|FE0308|FE034B|FE0352|FE0005|FE000C|FE02DF|FE0002|FE02EB" 
+"MRULABELS_DATAMANAGER_KEY" "FE0302|FE02FE|FE0000|FE0308|FE030C|FE02E2|FE02F7|FE034B|FE0352|FE0005|FE000C|FE02DF|FE0002|FE02EB" 
 "RESET_CPU_AFTER_DOWNLOAD_TAG" "VARIANT_TRUE_STORE_TAG" 
 "{287A8023-99B5-49E1-A54E-4DDCA43D7959}MapCtrlECX_MAP_FIND_SYMBOL_LIST" "" 
 "{287A8023-99B5-49E1-A54E-4DDCA43D7959}MapCtrlViews" "0" 
@@ -48,7 +48,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" "00000000000000EF" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000001" 
 "{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" 
@@ -56,12 +56,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" "0000000000FE0374" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FE030C" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFFD00" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000006FE" 
 "{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" "0000000000000081" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000085" 
 "{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" 
@@ -705,8 +705,8 @@
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1ColWidth1" "100" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1ColWidth2" "100" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1ColWidth3" "100" 
-"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1Exp0" "1" 
-"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1Exp1" "1" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1Exp0" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1Exp1" "0" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1Exp10" "1" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1Exp11" "1" 
 "{F866DB60-6186-11D5-8BBE-0004E2013C71}IOWnd1Exp12" "0" 
@@ -768,8 +768,8 @@
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
 "C:\Users\frkanaan\Desktop\p_sp4_2021_Freddy_Kanaan\sp4b1\SP4b1\SP4b1.c" 
+"C:\Users\frkanaan\Desktop\p_sp4_2021_Freddy_Kanaan\sp4b1\SP4b1\ncrt0.a30" 
 "C:\Users\frkanaan\Desktop\p_sp4_2021_Freddy_Kanaan\sp4b2\SP4b2\SP4b2.hws" 
-"C:\Users\frkanaan\Desktop\p_sp4_2021_Freddy_Kanaan\sp4b1\SP4b1\ncrt0.a30" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -816,5 +816,4 @@
 [FLASH_DETAILS]
 "" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
 [BREAKPOINTS]
-"c:\users\frkanaan\desktop\p_sp4_2021_freddy_kanaan\sp4b1\sp4b1\sp4b1.c" 18 16646882 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/KANAAN/sp4b1/SP4b1/SP4b1.c
===================================================================
--- branch/KANAAN/sp4b1/SP4b1/SP4b1.c	(revision 891)
+++ branch/KANAAN/sp4b1/SP4b1/SP4b1.c	(revision 892)
@@ -12,9 +12,9 @@
 #include "sfr32c87.h"
 
 unsigned char t, touche;
+
 void main()
 {
-
 	pd10=0xF0;
 	p10=0xFF;
 	pu30=1;
@@ -26,6 +26,17 @@
 		t=p10;
 		if(t!=0x0F)
 		{
+			p10=0x7F;
+			t=p10;
+			if(t==0x7E)
+				touche='3';
+			if(t==0x7D)
+				touche='6';
+			if(t==0x7B)
+				touche='9';
+			if(t==0x77)
+				touche='#';
+				
 			p10=0xBF;
 			t=p10;
 			if(t==0xBE)
@@ -32,10 +43,6 @@
 				touche='1';
 			if(t==0xBD)
 				touche='4';
-			if(t==0xBB)
-				touche='7';
-			if(t==0xB7)
-				touche='*';
 
 			p10=0xDF;
 			t=p10;
@@ -50,14 +57,10 @@
 
 			p10=0xEF;
 			t=p10;
-			if(t==0xEE)
-				touche='3';
-			if(t==0xED)
-				touche='6';
 			if(t==0xEB)
-				touche='9';
+				touche='7';
 			if(t==0xE7)
-				touche='#';
+				touche='*';		
 		}
 	}	
 }
Index: branch/KANAAN/sp4b2/SP4b2/SP4b2/SessionM32C_E8a_SYSTEM.hsf
===================================================================
--- branch/KANAAN/sp4b2/SP4b2/SP4b2/SessionM32C_E8a_SYSTEM.hsf	(revision 891)
+++ branch/KANAAN/sp4b2/SP4b2/SP4b2/SessionM32C_E8a_SYSTEM.hsf	(revision 892)
@@ -732,8 +732,8 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"C:\Users\frkanaan\Desktop\p_sp4_2021_Freddy_Kanaan\sp4b2\SP4b2\SP4b2\ncrt0.a30" 
 "C:\Users\frkanaan\Desktop\p_sp4_2021_Freddy_Kanaan\sp4b2\SP4b2\SP4b2\SP4b2.c" 
-"C:\Users\frkanaan\Desktop\p_sp4_2021_Freddy_Kanaan\sp4b2\SP4b2\SP4b2\ncrt0.a30" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -780,5 +780,5 @@
 [FLASH_DETAILS]
 "" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
 [BREAKPOINTS]
-"c:\users\frkanaan\desktop\p_sp4_2021_freddy_kanaan\sp4b2\sp4b2\sp4b2\sp4b2.c" 101 16647048 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"c:\users\frkanaan\desktop\p_sp4_2021_freddy_kanaan\sp4b2\sp4b2\sp4b2\sp4b2.c" 163 16647232 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/KANAAN/sp4b2/SP4b2/SP4b2/SP4b2.c
===================================================================
--- branch/KANAAN/sp4b2/SP4b2/SP4b2/SP4b2.c	(revision 891)
+++ branch/KANAAN/sp4b2/SP4b2/SP4b2/SP4b2.c	(revision 892)
@@ -32,20 +32,29 @@
 void lcd_str(unsigned char *str);// envoi d'une cha�ne de caract�re
 
 
-
 void tpo_us(unsigned short duree)
 {
-	tmod0_ta0mr=0;
-	tmod1_ta0mr=0;
-	mr1_ta0mr=0;       
-	mr2_ta0mr=0;       
-    mr3_ta0mr=0;      
-	tck0_ta0mr=0;     
-	tck1_ta0mr=0;
-	
-	//TA0=;
-	    
+	tcspr = 0x8A;
+    ta0mr = 0x82;
+    ta0 = duree;
+    ta0ic = 0x00;
+    ta0s = 1;
+    ta0os = 1;
+    while(ir_ta0ic != 1);
+	ta0s = 0;
+}
 
+
+void tpo_ms(unsigned short duree)
+{
+	tcspr = 0x8A;
+    ta0mr = 0x82;
+    ta0 = duree;
+    ta0ic = 0x00;
+    ta0s = 1;
+    ta0os = 1;
+    while(ir_ta0ic != 1);
+	ta0s = 0;
 }
 
 
@@ -89,35 +98,67 @@
 	LCD_E=0;	
 }
 
-void test_unitaire_4b (void)
+
+void lcd_8b(unsigned char car)
 {
-	lcd_4b(0xFF);
-	lcd_4b(0x00);
-	lcd_4b(0xA0);	
+	lcd_4b(car);
+    lcd_4b(car << 4);
 }
 
-void main(void)
+
+void lcd_car(unsigned char car)
 {
-	test_unitaire_4b();	
+	LCD_DC = 1;
+    lcd_8b(car);
 }
 
 
+void lcd_com(unsigned char com)
+{
+	LCD_DC = 0;
+	lcd_8b(com);
+}
 
-// initialize the LCD display
+
 void lcd_init(void)
 {
 	LCD_DC=0;
-//	tpo_ms(15);
+	tpo_ms(15);
 	lcd_4b(0x30);
-//	tpo_ms(5);
+	tpo_ms(5);
 	lcd_4b(0x30);
-//	tpo_us(100);
+	tpo_us(100);
 	lcd_4b(0x30);
-//	tpo_us(100);
+	tpo_us(100);
 	lcd_4b(0x20);
 //	lcd_com(0x28);
 //	lcd_com(0x06);
 //	lcd_com(0x0E);
 //	lcd_com(0x01);
-//	tpo_ms(5);
-}
\ No newline at end of file
+	tpo_ms(5);
+}
+
+
+void lcd_str(unsigned char *str)
+{
+	int i = 0;
+    while (str[i] != '\0')
+	{
+		lcd_car(str[i]);
+		i++;
+	}
+}
+
+
+void test_unitaire_4b (void)
+{
+	lcd_4b(0xFF);
+	lcd_4b(0x00);
+	lcd_4b(0xA0);	
+}
+
+
+void main(void)
+{
+	test_unitaire_4b();	
+}
Index: branch/KANAAN/sp4c12/sp4c1/c1/uart0.h
===================================================================
--- branch/KANAAN/sp4c12/sp4c1/c1/uart0.h	(revision 891)
+++ branch/KANAAN/sp4c12/sp4c1/c1/uart0.h	(revision 892)
@@ -1,5 +1,3 @@
 void uart0_init(void);
-
 void uart0_tx(char c);
-
 char uart0_rx(void);
Index: branch/KANAAN/sp4c12/sp4c1/c1/c1.c
===================================================================
--- branch/KANAAN/sp4c12/sp4c1/c1/c1.c	(revision 891)
+++ branch/KANAAN/sp4c12/sp4c1/c1/c1.c	(revision 892)
@@ -13,7 +13,87 @@
 #include "uart0.h"
 #include "uart0.c"
 
+
+void A2Z(void);
+int rectrame (char * Buffer);
+int hex_int(char *c);
+
+
+void A2Z(void)
+{
+	unsigned char i;
+	//while(1)
+		for(i='A'; i<='Z'; i++)
+			uart0_tx(i);
+}
+
+
+int rectrame (char * buffer)
+{
+        int i = 0;
+        int nb_caract = 0;
+        char char_recu;
+        char checksum_trame=0;
+        char checksum_fin_trame[3];
+        char calc_checksum = 0;
+       
+        char_recu = uart0_rx();
+ 
+        while(char_recu != '$')
+                i = 0;
+
+        buffer[0] = '$';
+
+        while(char_recu != '*')
+        {
+                char_recu = uart0_rx();
+				
+                buffer[i+1]= char_recu;
+                i++;
+
+                calc_checksum = calc_checksum ^ char_recu;
+        }
+
+        nb_caract = i;
+        return nb_caract;
+}
+
+int hex_int(char *c)
+{
+        int i=0;
+
+        /*La boucle permet de travailler sur les deux derniers caractères du checksum de la trame reçue**/
+        for(i=0; i<2; i++)
+        {
+                   /*si le caractère est entre 0 et 9 ->retranche en ascii '0', soit 48 en décimal*/
+                if(c[i]>='0' && c[i]<='9')
+                        c[i] = c[i]-48;
+
+                /*si le caractere est superieur a 10, soit A en hex ->retranche le nombre 55*/
+                if(c[i]>='A')
+                        c[i] = c[i]-55;
+        }
+        /*entier_cheksum= c[1] + 16*c[0]*/
+        return( c[1]+16*c[0] );
+}
+
+
 void main(void)
 {
-	
+	    char c;
+        char buffer; 
+        int i, nb_caractere;
+
+        uart0_init();
+
+        //c = '3';
+        while(1)
+        {
+                char trame[128];
+                c = uart0_rx();
+                uart0_tx(c);
+                nb_caractere = rectrame(trame);
+                //alphabet();
+        }
 }
+
Index: branch/KANAAN/sp4c12/sp4c1/c1/uart0.c
===================================================================
--- branch/KANAAN/sp4c12/sp4c1/c1/uart0.c	(revision 891)
+++ branch/KANAAN/sp4c12/sp4c1/c1/uart0.c	(revision 892)
@@ -58,16 +58,29 @@
 	
 	te_u0c1=1;
 	re_u0c1=1;
+
+	        // Config port 6 pd6 = 0x08
+/*
+        pd6_1 = 0;
+        pd6_2 = 0;
+		
+        ps0_1 = 0;
+        ps0_2 = 0;
+        ps0_3 = 1;        
+*/
 }
 
 
 void uart0_tx(char c)
 {
-	
+	te_u0c1 = 1;
+    u0tb = c;
+	te_u0c1 = 0;
 }
 
 
 char uart0_rx(void)
 {
-	
+	        while(ri_u0c1!=0)
+            return u0rb;
 }
