We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
My project uses a P89LPC932 @ 11.0592 MHz and CCLK equal to Fosc (11.0592MHz). UART uses BGRG1:BGRG0 as Baud Rate Generator. Buad = CCLK/((BRGR1,BRGR0)+16) I want to mensurate width of pulse by ICA of CCU. A series pulses comes from a 'U' (55 HEX). When Down edge of Start Bit comes, ICA capture first value T1. When Up edge of First Data Bit comes, ICA capture second value T2. So we have got a Count , Count = T2 - T1. My question : How can we set BGRG1:BGRG0 from Count ? e.g. BGRG1:BGRG0 = Count * x +/- y ?
"So We must Detect Baud of MCU addressed immediately. if We can get Count = T2 - T1, and set BGRGx from Count, it is fast !" Personally, I'd still use 'Count' to look up BGRG values out of a table like Michael suggests in his last paragraph. If you want to calculate it, assuming you have the CCU configured with 1:1 prescale, wouldn't that be: BGRG1:BGRG0 = Count * 8 - 16?