Академический Документы
Профессиональный Документы
Культура Документы
MAX485
USB Interface RS485 UART
ou STM32F407
PC USB <-> RS485
équivalent
Voir page 60 de DM00037051_Datasheet.pdf pour trouver les pins de UART possibles (PA9 et PA10 sont
des broches possibles du USART1, mais elles ne marchent pas en raison du point suivant)
Il faut vérifier que les broches de USART (un UART avec fonctionnalités additionnelles) choisi ne sont pas
déjà utilisées sur le kit de développement
2) Comment trouver un logiciel PC pour envoyer les octets, et, surtout, le checksum qui n’est pas
une valeur ASCII
a. Drivers
b. Logiciels disponibles
c. ASCII versus hexadecimal
d. Un mot sur l’ouverture des ports série
char UartRxCB[TAILLE_DE_BUFFER_RX];
char UartTxCB[TAILLE_DE_BUFFER_RX];
int UartRxCB_WriteIndex;
int UartRxCB_ReadIndex;
int UartTxCB_WriteIndex;
int UartTxCB_ReadIndex;
void UART_ISR(void)
{
char ByteRx;
UartRxCB[UartRxCB_WriteIndex] = ByteRx;
UartRxCB_WriteIndex++;
If(UartRxCB_WriteIndex >= sizeof(UartRxCB))
UartRxCB_WriteIndex = 0;
}
{
char ByteToParse;
char lCommand;
char lCommandData;
InitUART();
InitLCD();
while(UartRxCB_ReadIndex != UartRxCB_WriteIndex)
{
ByteToParse = UartRxCB[UartRxCB_ReadIndex]
UartRxCB_ReadIndex++;
if(UartRxCB_ReadIndex >= sizeof(UartRxCB)
UartRxCB_ReadIndex = 0;