1

I wanted to try to interface the pcf7991at with arduino, I assembled the pcb containing the pcf7991at following the diagram shown in the datasheet. I saw that a frequency of 125khz must go on the CLK pin of the pcf, so I ask you if it is possible to use an internal arduino timer to try to see if the pcf7991at works.

1
  • are you asking if the Arduino is able to output 125 kHz signal at one of its pins? ... what diagram are you talking about?
    – jsotola
    Commented May 3, 2023 at 17:49

2 Answers 2

1

The communication between MCU (Arduino) and IC (PCF7991AT) can work at any frequency (like SPI or I2C). The 125khz antenna frequency is generated in the IC internally. But you need to set the divider of the clock source (your crystal hooked up to the IC)

https://datasheet.lcsc.com/lcsc/2208260930_NXP-Semicon-PCF7991AT-1081-M_C5143533.pdf

See page 7 -> 8.4 short explanation page 13 -> to set the register

Hope this helps!

0

The Arduino is indeed capable of generating a 125kHz signal. This example generates a 125kHz signal (50% duty cycle) on digital pin 3 of an Arduino Uno/Nano using Timer 2.

const int pulsePin = 3;  // note OC2B Pin D3 ! ! ! 
volatile uint32_t pulseCount = 0;

void setup(){

  pinMode(pulsePin, OUTPUT);

  cli() ;
  TCCR2A = 0;
  TCCR2B = 0;
  TCNT2 = 0;
  OCR2A = 127 ; // f =  125kHz @16MHz clock
  OCR2B = (float) OCR2A * 0.5 ; 
  TCCR2A |= (1 << WGM21) | (1 << WGM20) | (1 << COM2B1 ) ; // Mode 7 (fast PWM )
  TCCR2B |= (1 << CS20) | (1 << WGM22) ;   // ps /1  mode 7
  sei() ;
}

void loop() {
}
1
  • and how i check rising of the timer?, i need to read a particular register to see if timer is rised and eventually set to 0 after? Commented May 12, 2023 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.