


USART1中断方式接收调试完成。功能是将PC机发送来的代码通过中断方式接收,并将接收内容直接返回。程序主循环是LED流水灯。PC端使用串口调试助手。
主程序及中断程序代码如下:
myUSART_led_int.rar
下一步调试液晶。
主程序及中断程序代码如下:
myUSART_led_int.rar
下一步调试液晶。

看这里就知道了:
/*******************************************************************************
* Function Name : LCD_WriteReg
* Description : Writes to the selected LCD register.
* Input : - LCD_Reg: address of the selected register.
* - LCD_RegValue: value to write to the selected register.
* Output : None
* Return : None
*******************************************************************************/
void LCD_WriteReg(u16 LCD_Reg,u16 LCD_RegValue)
{
/* Write 16-bit Index, then Write Reg */
ClrCs
LCD->LCD_REG = LCD_Reg;
/* Write 16-bit Reg */
LCD->LCD_RAM = LCD_RegValue;
SetCs
}
/*******************************************************************************
* Function Name : LCD_WriteReg
* Description : Writes to the selected LCD register.
* Input : - LCD_Reg: address of the selected register.
* - LCD_RegValue: value to write to the selected register.
* Output : None
* Return : None
*******************************************************************************/
void LCD_WriteReg(u16 LCD_Reg,u16 LCD_RegValue)
{
/* Write 16-bit Index, then Write Reg */
ClrCs
LCD->LCD_REG = LCD_Reg;
/* Write 16-bit Reg */
LCD->LCD_RAM = LCD_RegValue;
SetCs
}