and tried to include as asm on my project to set GPIO fast:
__asm__ volatile ("movi a2, 0x60000304\n"
"movi a4, %0\n"
"s32i a4, a2, 0\n"
::"r" (setbits):"a2", "a4");
setbits is a static uint16;
However the linker gives me: undefined reference to `a5' (that I'm not using). Could you please advice on what can be wrong? Thank's in advance.
Code: Select all
40211022: fff831 l32r a3, 40211004 <_irom0_text_start+0x4>
40211025: fff621 l32r a2, 40211000 <_irom0_text_start>
40211028: 0020c0 memw
4021102b: 006232 s32i a3, a2, 0
My hypothesis is that the W1TS in the name of the register means "write 1 to set". There are other definitions in eagle_soc.h containing W1TC meaning "write 1 to clear".
You could create some macros that are less verbose and, perhaps, more suggestive of their function, e.g.
Code: Select all
#define GPIO_OUT_SET(m) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, m)
Beaverton, OR, USA
I keep wondering why all these people want to toggle GPIO pins at Mhz rate???? If it's for pwm, just use the supplied pwm functionality, no need to re-invent it yourself.
The atmega328p has a 16 bits counter/timer/pwm that can run directly on the system clock which is 20 MHz at most. That will give you a 16 bit resolution at 305 Hz AT MOST. I've found that actually the required resolution is about 12 bits (for tuning leds right down to almost invisible in the dark), then you could achieve 5 KHz rate. And then we're talking dedicated hardware on the not-low-end-atmel series.
I think you should reconsider if your goals are realistic. The SDK PWM functionality already is quite efficient, I doubt you can do very much better than that (and still keep the SDK code happy).
Who is online
Users browsing this forum: Google [Bot] and 12 guests
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!