This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Aduc842: Doubts about timer2 and timer3.

Hello,

I'm new with microcontrollers and I have some questions.

I'm using the Aduc842 with a 32.768KHz crystal. I want to use the Analog to Digital Converter and I want to get 8000 samples per second. I'm using timer2 for the interrupt of ADC.

I saw this in an example:

sample period = 2 * T2 reload prd=2*(10000h-FFF4h)*5.722us=2*11*5.722us=125.884us


Where does 5.722us come from? Can you help me to choose the right RCAP2L, RCAP2H, TL2, TH2?

I also want to send via UART some data with 115200 baudrate that I generate with timer3. VDD is 3v, and I read that the maximum coreclock when VDD=3v is 8.38MHz and that CD bits shouldn't be 0.

With this, is it possible to reach 115200 baudrate with a 8.38MHz coreclock? what value should be T3CON and T3FD?

Parents
  • I'm using the Aduc842 with a 32.768KHz crystal. I want to use the Analog to Digital Converter and I want to get 8000 samples per second. I'm using timer2 for the interrupt of ADC.
    Let me assume it is a 6 clocker and then at 32kHz you get ~5000 instruction cycles (~2000 instructions) executed per second. That makes it darn difficult to get 8000 samples in that time. even if it was a one-clocker (I have heard of no oneclockesr but the SILabs) you would not be able to process a sample in 4 instruction cycles (~2 instructions)

    also
    I also want to send via UART some data with 115200 baudrate that I generate with timer3
    put that into the Keil baudrate calculator http://www.keil.com/c51/baudrate.asp together with your clock speed and see.

    As stated above, I assume about a chip I do not use, If it has a PLL or some such thing I am totally off the rocker.

    I guess you need to clarify some things and a link to the datasheet would be nice.

    Erik

Reply
  • I'm using the Aduc842 with a 32.768KHz crystal. I want to use the Analog to Digital Converter and I want to get 8000 samples per second. I'm using timer2 for the interrupt of ADC.
    Let me assume it is a 6 clocker and then at 32kHz you get ~5000 instruction cycles (~2000 instructions) executed per second. That makes it darn difficult to get 8000 samples in that time. even if it was a one-clocker (I have heard of no oneclockesr but the SILabs) you would not be able to process a sample in 4 instruction cycles (~2 instructions)

    also
    I also want to send via UART some data with 115200 baudrate that I generate with timer3
    put that into the Keil baudrate calculator http://www.keil.com/c51/baudrate.asp together with your clock speed and see.

    As stated above, I assume about a chip I do not use, If it has a PLL or some such thing I am totally off the rocker.

    I guess you need to clarify some things and a link to the datasheet would be nice.

    Erik

Children