These are chat archives for esp8266/Arduino

9th
May 2015
Markus
@Links2004
May 09 2015 09:55
i currently have a strange problem. when i use GPOC and GPOS to set the GPIO pins i only get a frequency of 8MHz out. if i put the core 80MHz or 160MHz i get the same result. is there some sort of GPIO limiter like in an Cortex?
ficeto
@ficeto
May 09 2015 09:56
probably it uses the APB clock for GPIO which is constant
strangely enough though I had to adjust the I2C speeds for 160MHz
I was able to get faster speeds though
smething in the ballpark of 45ns
how do you measure that time?
Markus
@Links2004
May 09 2015 09:59
i have an 8CH logic analyzer with up to 24Mhz and an old oscilloscope (non digital)
ficeto
@ficeto
May 09 2015 10:01
if you think about it, 8MHz is not that bad :) those are 16 switches per microsecond or 60ns per switch
not that far from my tests
Markus
@Links2004
May 09 2015 10:02
yes but the chip hardware can handle 80Mhz on SPI so it is possible to go faster.
ficeto
@ficeto
May 09 2015 10:02
BTW what logic analizer do you use?
I imagine the switching of the SPI is not related
Markus
@Links2004
May 09 2015 10:03
its an saleae logic 8ch
ficeto
@ficeto
May 09 2015 10:04
as on other MCUs, the peripheral clock output is controlled separately in the MCU and it's why it can do higher speeds
the GPIO calls probably go through other circuits and checks
GPI takes roughly twice the GPOS/C calls
Markus
@Links2004
May 09 2015 10:07
i currently try to speed up the SPI display i use. this display has an chips select and a select for switch between data and command frames. infarct the too lines need more time then the data.
ficeto
@ficeto
May 09 2015 10:08
yes :) and it's the reason why many SPI ports have multiple CS pins
those integrated CS pins can be controlled by the SPI registers and some can even run autonomously, so no intervention is neede on your side to switch the basic ChipSelect
and you need to control only when the other CSs have to change (RW/DC.. so on pins)
and that is also done in the SPI register
Markus
@Links2004
May 09 2015 10:11
good info, will try to integrate this in the SPI implementation.
ficeto
@ficeto
May 09 2015 10:12
on another note, is your library switching those for each pixel?
Markus
@Links2004
May 09 2015 10:13
no
ficeto
@ficeto
May 09 2015 10:13
if screen is not large, maybe yu can keep the frame buffer into memory and write the whole screen at once
then 160 ns should not be that big of an issue
Markus
@Links2004
May 09 2015 10:15
not possible i have 230*240 at RGB = ~165kB to less Ram
ficeto
@ficeto
May 09 2015 10:15
yeah...
I have probably the same screen as you and I'm using it in small oscillo-like sketches
in those cases, I write as little as possible
clearing previous pixel value and writing the new
ficeto
@ficeto
May 09 2015 10:18
:D as I said... same as mine
what is your sketch doing with the screen?
console output or graph
Markus
@Links2004
May 09 2015 10:20
later i plane graph stuff, at the moment i run the Adafruit benchmarks
to optimize the screen rendering
ficeto
@ficeto
May 09 2015 10:21
so yeah... picking which pixels to update will speed things up
but adafruit's things write the whole screen
still should be pretty fast
any issues with Adafruits Graphic lib?
Markus
@Links2004
May 09 2015 10:22
yes with an normal arduino its slower
no the lib is working fine
may i also try to send complete images over wifi from my server later on
ficeto
@ficeto
May 09 2015 10:23
that would be fun :D
ficeto
@ficeto
May 09 2015 10:32
btw binary upload has some issues I need to take care of
text files are uploading fine, but some images fail
Markus
@Links2004
May 09 2015 10:33
uploading from where to where ?
ficeto
@ficeto
May 09 2015 10:33
from file input form to the ESP
POST file parsing is at fault somewhere
Markus
@Links2004
May 09 2015 10:34
may the "\0" is the problem
interpreted as "string" end
ficeto
@ficeto
May 09 2015 10:34
I do byte writes, so that is not it
and byte reads
I check if the char value of the byte equals '\r'
then get on with checking if it's the end of the file, if not I write the '\r' to the buffer
Markus
@Links2004
May 09 2015 10:38
does the browser not send you and Content-Length?
if i remember HTTP post right the end of an bin data block in mix content also has two "\r"
ficeto
@ficeto
May 09 2015 10:40
I think I found where the issue might be
if I get '\r' then I get '\n', I read as string
should keep reading as binary
ficeto
@ficeto
May 09 2015 10:57
yup :) that was it
ficeto
@ficeto
May 09 2015 11:22
esp8266/Arduino#209
Markus
@Links2004
May 09 2015 14:21
many optimization later --> 3x faster display and new us full SPI functions Links2004/Arduino@2d37fb6
Spencer Graff
@s-graff
May 09 2015 22:13
can someone please help? I feel lost at a very basic point. I think the 1.6 release is allowing the digitalWrite with the pin as the GPIO. For some reason, now this logic doesn't seem to work using the github latest.