tag:blogger.com,1999:blog-6245413346375218188.post4841915446626055447..comments2024-03-15T05:42:04.481-07:00Comments on Nerd Ralph: A 4mbps shiftOut for esp8266/ArduinoRalph Doncasterhttp://www.blogger.com/profile/00037504544742962130noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-6245413346375218188.post-83807255019888775972019-03-17T09:27:39.153-07:002019-03-17T09:27:39.153-07:00Hi Ralph, I have also been doing some work on ESP8...Hi Ralph, I have also been doing some work on ESP8266 and ESP32 with regard to bitbanging and toggling pins, and I found that cutting every single wasted clock cycle out really helps, for instance, you have several instances of "1 << CLOCK" etc, if you replaced this with a hardcoded value or something #defined then you would see small improvements in speed. also I have found that is you clear both the DATA and CLOCK at the same time (rather than two separate ones) and then you only need to set the data if (data & 0x80) is true, this will save even more time ! keep up the good work. BobBob Lynashttps://www.blogger.com/profile/12384964186515448219noreply@blogger.comtag:blogger.com,1999:blog-6245413346375218188.post-27902083748944060662015-12-09T06:07:22.615-08:002015-12-09T06:07:22.615-08:0016mbps is pretty good. I haven't done much lo...16mbps is pretty good. I haven't done much low-level esp8266 work lately, but I think 10mbps is feasible for bit-banging when running the MCU at 160Mhz.<br />I find the spi_transaction function unnecessarily complex. Abstracting away the command/address/data and just having data out and data in would be better IMHO.Ralph Doncasterhttps://www.blogger.com/profile/00037504544742962130noreply@blogger.comtag:blogger.com,1999:blog-6245413346375218188.post-19770137291323202962015-12-09T01:55:11.799-08:002015-12-09T01:55:11.799-08:00Take a look at this SPI lib https://github.com/Met...Take a look at this SPI lib https://github.com/MetalPhreak/ESP8266_SPI_Driver.<br />I got 16mbits after optimizing the spi_transaction function (moved spi register setup to a second method).Anonymoushttps://www.blogger.com/profile/03995084766654505875noreply@blogger.comtag:blogger.com,1999:blog-6245413346375218188.post-84851192380307233512015-06-24T11:37:13.797-07:002015-06-24T11:37:13.797-07:00Ralph, see this link for a GPIO toggling example i...Ralph, see this link for a GPIO toggling example in ASM: http://bbs.espressif.com/viewtopic.php?t=200&p=987#p956Unknownhttps://www.blogger.com/profile/08236516276702991065noreply@blogger.comtag:blogger.com,1999:blog-6245413346375218188.post-34336819400047735032015-06-16T15:09:32.816-07:002015-06-16T15:09:32.816-07:00I looked at the code disassembly, and the GPIO_REG...I looked at the code disassembly, and the GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, X) compiles to a single instruction. Same thing for GPIO_OUT_W1TS_ADDRESS for setting, so I can't see any benefit to doing it differently.Ralph Doncasterhttps://www.blogger.com/profile/00037504544742962130noreply@blogger.comtag:blogger.com,1999:blog-6245413346375218188.post-35908477035760694512015-06-14T10:44:49.651-07:002015-06-14T10:44:49.651-07:00Have you seen the GPIO_OUT_ADDRESS register? It a...Have you seen the GPIO_OUT_ADDRESS register? It acts like a "port" allowing you read/write all GPIO 0-15. Sixteen uses a different register.Anonymoushttps://www.blogger.com/profile/01212671432860702897noreply@blogger.com