ESP8266 Developer Zone The Official ESP8266 Forum 2015-08-21T16:07:59+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=979 2015-08-21T16:07:59+08:00 2015-08-21T16:07:59+08:00 https://bbs.espressif.com:443/viewtopic.php?t=979&p=3357#p3357 <![CDATA[Re: GPIO Performance]]>
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).

Statistics: Posted by eriksl — Fri Aug 21, 2015 4:07 pm


]]>
2015-08-21T08:12:06+08:00 2015-08-21T08:12:06+08:00 https://bbs.espressif.com:443/viewtopic.php?t=979&p=3343#p3343 <![CDATA[Re: GPIO Performance]]> Statistics: Posted by skywave — Fri Aug 21, 2015 8:12 am


]]>
2015-08-21T05:04:50+08:00 2015-08-21T05:04:50+08:00 https://bbs.espressif.com:443/viewtopic.php?t=979&p=3340#p3340 <![CDATA[Re: GPIO Performance]]>
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.

Statistics: Posted by eriksl — Fri Aug 21, 2015 5:04 am


]]>
2015-08-20T23:03:21+08:00 2015-08-20T23:03:21+08:00 https://bbs.espressif.com:443/viewtopic.php?t=979&p=3335#p3335 <![CDATA[Re: GPIO Performance]]>

Code:

40211000:   60000304
40211004:   8000
[...]
   GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, 0x8000);
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:

#define GPIO_OUT_SET(m)  GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, m)

Statistics: Posted by dkinzer — Thu Aug 20, 2015 11:03 pm


]]>
2015-08-20T21:33:30+08:00 2015-08-20T21:33:30+08:00 https://bbs.espressif.com:443/viewtopic.php?t=979&p=3334#p3334 <![CDATA[GPIO Performance]]> http://naberius.de/2015/05/14/esp8266-g ... rformance/

and tried to include as asm on my project to set GPIO fast:

__asm__ volatile ("movi a2, 0x60000304\n"
"movi a4, %0\n"
"memw\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.

Statistics: Posted by skywave — Thu Aug 20, 2015 9:33 pm


]]>