How to increase clk frequency on an output pin in ESP 12e?
Posted: Wed Oct 02, 2019 8:19 pm
Hi, I'm Using a ESP 12-e module in arduino IDE. I want to generate a clock and a data on my pins to communicate with a custom device. Something like this:
This is my related piece of code:
My problem is to increase CLK frequency. it seems that digitalWrite command take about 800 ESP clock to run!(I measured it with ESP.getCycleCount()).
Can anyone suggest a solution to increase CLK frequency up to 8 Mhz?
Thanks
This is my related piece of code:
Code: Select all
pinMode(CLK , OUTPUT);
pinMode(DOUT , OUTPUT);
//
void Write_Bit_0(void){
digitalWrite( DOUT , LOW );
digitalWrite( CLK , HIGH );
digitalWrite( CLK , LOW );
}
void Write_Bit_1(void){
digitalWrite( DOUT , HIGH);
digitalWrite( CLK , HIGH );
digitalWrite( CLK , LOW );
}
//
....
My problem is to increase CLK frequency. it seems that digitalWrite command take about 800 ESP clock to run!(I measured it with ESP.getCycleCount()).
Can anyone suggest a solution to increase CLK frequency up to 8 Mhz?
Thanks