2015-03-16 05:40 AM
;Uart variables
M EQU 4 ; 8 ou 9 bit CR1
stop EQU 5 ; 1 stop bit CR3
bits EQU 4 ; 2 stop bit CR3
TC EQU 6 ; TC flag fin d'envoi
TXE EQU 7 ; TXE flag write data
CKEN EQU 3 ; clock mode in CR3
REN EQU 2 ; REN bit recept mode in CR2
TEN EQU 3 ; TEN bit transmit mode in CR2
; init UART2
reset_uart_register
mov UART2_CR1,#0
mov UART2_CR2,#0
mov UART2_CR3,#0
init_UART2 ; 2400 bauds = 000.000 / 2200 = 6666d = 1A0B hex
bres UART2_CR1 , #M ; word lenth 8 bits
bset UART2_CR3 , #stop ; 2 bits stops
bset UART2_CR3 , #bits ; 2 bits stops
mov UART2_BRR1 , #$A0 ; UART2 Baud Rate Register 1
mov UART2_BRR2 , #$1B ; UART2 Baud Rate Register 2
ld A , UART2_CR3
''break point'' nop
rim ;reset the cpu interupt mask
; end of initialisation of all peripherals
hereunder a screenshot of the STVD IDE at the break point
thanks for your help.
Joël
2015-03-16 03:02 PM
I have found my problem . I had remove UART clock . grrrr !!!
mov CLK_PCKENR1 , #%11110000 ;supprime le clock sur les oscillateurs pour les UART , SPI et I2C /!\ replace by mov CLK_PCKENR1 , #%11111100 ;supprime le clock sur les oscillateurs pour lesUART
, SPI et I2C /!\