 
					
				
		
Hi,
How to use UART with PE(AsynchroSerial) in S12ZVCA?
Have any example?
Best Regards,
Aaron
Solved! Go to Solution.
 danielmartynek
		
			danielmartynek
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Aaron,
The correct code creates an instance of AS1_TComData and then the function takes the address of the instance as a argument. The wrong code creates only a pointer. But the pointer doesn't point anywhere.
Regards,
Daniel
 
					
				
		
Hi Daniel,
I try to use Event of AS1_OnRxChar. It can work fine in DEBUG mode. But it can not work in NORMAL mode (remove MULTILINK then power off/on my board).
P.S. Main() code can work fine in both (DEBUG/NORMAL) mode.
void AS1_OnRxChar(void)
{
AS1_TComData *ReceiveChar;
/* Write your code here ... */
AS1_RecvChar(ReceiveChar);
switch(*ReceiveChar)
{
case 'C':
Pin_DO3 = 1; // LED4 OFF
Pin_RCK_DoorLock = 0; // Door Lock (Lo Active)
setReg8(DDRS, 0xF3U);
break;
case 'O':
Pin_DO3 = 0;// LED4 ON
Pin_RCK_DoorUnlock = 0; // Door Unlock (Lo Active)
setReg8(DDRS, 0xF5U);
break;
default:
setReg8(DDRS, 0xF1U);
break;
}
return;
}
 
					
				
		
 
					
				
		
Hi, Daniel,
I resolved the issue. But, I don't know why.
The wrong code as follow:
AS1_TComData *ReceiveChar;
AS1_RecvChar(ReceiveChar);
switch(*ReceiveChar)
The correct code as follow:
AS1_TComData ReceiveChar;
AS1_RecvChar(&ReceiveChar);
switch(ReceiveChar)
Best Regards,
Aaron
 danielmartynek
		
			danielmartynek
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Aaron,
The correct code creates an instance of AS1_TComData and then the function takes the address of the instance as a argument. The wrong code creates only a pointer. But the pointer doesn't point anywhere.
Regards,
Daniel
 
					
				
		
Hi Daniel,
Thank you so much!
Best Regard,
Aaron
 
					
				
		
Hi Daniel,
ZVL32-SCI-CW106 can work fine. Then, I modify SCI0 to SCI1 (ZVL32-SCI1-CW106 as attachment). It can work, too.
But, I got many error when I merge the SCI1.c & SCI1.h into my Processor Expert project(B0005_Test as attachment). I don't know how to solve the error.
Have any SCI (UART) example for Processor Expert?
Best Regards,
Aaron
 danielmartynek
		
			danielmartynek
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
types byte and word are undefined.
You should define them in SCI1.h header file:
typedef unsigned char byte;
typedef unsigned int word;
Regards,
Daniel
 danielmartynek
		
			danielmartynek
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		