Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By martinayotte
#45126 Unfortunately, NMI means "Non Maskable Interrupt", there is no way to turn it off, at least from what I know, maybe replacing it's vector by a dummy one which simply do a return, but it is low level knowledge that I don't have yet.
User avatar
By s1sm1x
#63602 Hi everyone!
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 :D

Thank you for the attention and hoping to get things resolved as soon as possible,
s1sm1x
User avatar
By 123francoz
#63612 Hi, as you can see on the first page of this thread
you can do it with gpio SET and CLEAR instructions referred to a single pin:
Code: Select all    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:
Code: Select all    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