My knowledge on this architecture is at the starting point and datasheets are not helping much.
Thank you for helping me
After reading a bunch of stuff about port manipulation on Arduino and ESP8266, I'm not able to fully convert some commands from an Arduino library to an ESP8266. When compiling on Arduino IDE before uploading to ESP8266, it stops in the Arduino Manipulation ports pasted below. This is a frequency detector library on this thread: https://forum.arduino.cc/index.php?topic=121540.0 from arduino forum (DTMF.zip from the first post). I tried several commands for port manipulation based on the ones metioned in this post for GPO controlling.
Can someone help me converting these port manipulation ports from Arduino to ESP? If I can't detect correctly the frequencies in ESP as I do on Arduino, I will have to discard that approach, which I really don't want because I have all the rest (POST, GET, DATABASE, Android App) already implemented, this is the only non working part.
on line 102 of the dtmf.cpp
DDRD |= B00010000;
// Set pin 4 LOW
PORTD &= B11101111;
------
on line 159 of the dtmf.cpp
PORTD ^= f_counter; (i know this is xor. f_counter = 0x10 )
I would like to understand more about port manipulation and ESP, so any explanation will be really appreciated
Thank you for the attention and hoping to get things resolved as soon as possible,
s1sm1x
you can do it with gpio SET and CLEAR instructions referred to a single pin:
GPOS = 1<<(number of portpin to turn on);
GPOC = 1<<(number of portpin to turn off);
or if you are more confident to manipulate the entire port register as you do on Arduino, you can write:
GPO |= 0x00000004;
GPO &= 0xFFFFFFFB;
(keep in mind all those registers are 32bit long)
And at the end, i wanna remember you that there are some interrupts running in the background that may conflict with your frequency measurements