These are chat archives for esp8266/Arduino

5th
May 2015
Ivan Grokhotkov
@igrr
May 05 2015 09:14
@ficeto regarding open-drain outputs
i think esp GPIOs support open-drain output mode, so there is no need to change output state with pinMode
ficeto
@ficeto
May 05 2015 09:16
they are controlled by basically 3 registers
it'snothing like in AVR, but it's much flexible
so GPE switches between INPUT/OUTPUT
GPO sets what is the level when GPE is 1
GPI reads the level when GPE is 0
then pulls work only when GPE is 0 (INPUT)
Ivan Grokhotkov
@igrr
May 05 2015 09:19
yes i understand that :) but the pin driver can also work in open-drain mode
there's a GPIO_PAD_DRIVER_ENABLE bit for that
in that mode you just change what you call GPO to switch between "forced down" and "hi-z" modes
ficeto
@ficeto
May 05 2015 09:20
PAD driver as far as I know control the amount of current that the pin will drive
Ivan Grokhotkov
@igrr
May 05 2015 09:21
i thought espressif calls the lower part to the output driver "pad driver"
this is in sync with their i2c code:
    GPIO_REG_WRITE(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO)), GPIO_REG_READ(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO))) | GPIO_PIN_PAD_DRIVER_SET(GPIO_PAD_DRIVER_ENABLE)); //open drain;
    GPIO_REG_WRITE(GPIO_ENABLE_ADDRESS, GPIO_REG_READ(GPIO_ENABLE_ADDRESS) | (1 << I2C_MASTER_SDA_GPIO));
    GPIO_REG_WRITE(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SCL_GPIO)), GPIO_REG_READ(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SCL_GPIO))) | GPIO_PIN_PAD_DRIVER_SET(GPIO_PAD_DRIVER_ENABLE)); //open drain;
    GPIO_REG_WRITE(GPIO_ENABLE_ADDRESS, GPIO_REG_READ(GPIO_ENABLE_ADDRESS) | (1 << I2C_MASTER_SCL_GPIO));
ficeto
@ficeto
May 05 2015 09:24
let melook at their register definitions
Ivan Grokhotkov
@igrr
May 05 2015 09:26
you even have this defined: GPCD
ficeto
@ficeto
May 05 2015 09:29
yeah and in pinMode I set the driver to normal when OUTPUT and OPENDRAIN when input
what will happen if you set opendrain on output and write 1 to it?
I imagine - nothing
Ivan Grokhotkov
@igrr
May 05 2015 09:31
the pin will be driven low
oh, 1
the pin will be hi-z
(or pulled up/down, if you have a pull-up/down enabled)
ficeto
@ficeto
May 05 2015 09:32
but it's an OUTPUT, so I am supposed to DRIVE something on the output
Ivan Grokhotkov
@igrr
May 05 2015 09:32
yeah, but when it is in open-drain mode it can only drive down
that's what the open-drain mode is for
so you can wire things in a logical-or fashion and just use the output register, without having to switch modes and whatnot
ficeto
@ficeto
May 05 2015 09:34
which is basically the same that my I2C does
Ivan Grokhotkov
@igrr
May 05 2015 09:35
if i2c works, then i don't have an issue with that)
adding OUTPUT_OPEN_DRAIN is pretty much orthogonal to I2C implementation
i have just pasted a snipped of espressif's i2c code to show that they use this mode.
and the previous version of i2c also did use that mode
but that's irrelevant now :)
ficeto
@ficeto
May 05 2015 09:36
yes and looking at what I do is the same :)
pinMode(twi_sda, INPUT_PULLUP);
then just manipulate the GPE register
so when GPE is 1, it in that OUTPUT_OPEN_DRAIN mode
Ivan Grokhotkov
@igrr
May 05 2015 09:39
why do you set the GPCD bit for pinMode(, INPUT)?
ficeto
@ficeto
May 05 2015 09:40
so it's in HI-Z mode
Ivan Grokhotkov
@igrr
May 05 2015 09:40
if you disable output it will be in hi-z automatically
GPCD just changes the way output driver works
i.e. if you don't have the output driver enabled, no need to change GPCD
ficeto
@ficeto
May 05 2015 09:41
can not recall my tests now... but it came that way
i spent quite some time a few months back going through register combinations
plus you can see that done in their I2C as well
maybe pulls did not work... do not remember really
ficeto
@ficeto
May 05 2015 10:08
esp8266/Arduino#176
@igrr have you talked to Espressif about that network issue?
ficeto
@ficeto
May 05 2015 10:13
if file is even larger (tried 900KB) watchdog resets when the error condition is met
i guess that is because the TCP keeps sending the same packet, and the incomming queue hangs full for too long
Ivan Grokhotkov
@igrr
May 05 2015 10:20
not yet, i need to reproduce that issue with an example which doesn't have all the arduino stuff included
otherwise i don't think they will consider that bug
ficeto
@ficeto
May 05 2015 10:37
ok
i'll do it then
i have most written already anyway
but will not go without the arduino SD library
since it's dependent on that to have the large file
Ivan Grokhotkov
@igrr
May 05 2015 10:41
Perhaps you can push the library as is. I wouldn't say it is strictly dependent on large files... Just add a line to the Readme that there is an issue with files > 10k for now...
i have most written already anyway
you mean you have a standalone (Arduino-less) example written?
my bad, i read your message again, got it :)
ficeto
@ficeto
May 05 2015 10:43
yes, in C but without the SD library in it
have to translate that into plain C
the FAT part of it is not small :)
Ivan Grokhotkov
@igrr
May 05 2015 10:54
you can use the flash contents as the "large file"
basically create a web server that will send the flash contents to the client
it's 512K, so should be enough to trigger the issue
Ivan Grokhotkov
@igrr
May 05 2015 11:16
@ficeto created an issue for that: esp8266/Arduino#177
I want to have a new release next week. Will focus on fixing the network issues (a bunch of udp issues and WebServer mem leak), and will repackage the core files so that the hardware folder can be distributed separately from the IDE.
ficeto
@ficeto
May 05 2015 11:18
ok, you do that
i guess you will look at the new api as well
since they have mdns and ntp in the core now
Ivan Grokhotkov
@igrr
May 05 2015 11:19
Not sure i will do that for the current release. Fix bugs first, add features later :)
ficeto
@ficeto
May 05 2015 11:19
i'll focus on the other issue.
sure
Ivan Grokhotkov
@igrr
May 05 2015 11:20
Also there has been a regression with HardwareSerial, #172
will also take a look at that today
onkelfunny
@onkelfunny
May 05 2015 16:27
return the function ESP.getFlashChipSize() the real hardware size or the size who is set at the compile process?
Markus
@Links2004
May 05 2015 16:28
its the compile time for real size use ESP.getFlashChipSizeByChipId();
onkelfunny
@onkelfunny
May 05 2015 16:28
thx
this function returns 0
void loop() {
  Serial.println(ESP.getFlashChipSizeByChipId());
  delay(3000);
}
Markus
@Links2004
May 05 2015 16:30
ok then you have an chip that is not on list :) can you send me: Serial.println(ESP.getFlashChipId(),HEX);
onkelfunny
@onkelfunny
May 05 2015 16:32
1640EF
Markus
@Links2004
May 05 2015 16:33
ok you flash has an other manufacturer (Winbond) will check the documents and add it to the function.
onkelfunny
@onkelfunny
May 05 2015 16:34
thx
1640ef Winbond W25Q32 4MB
Markus
@Links2004
May 05 2015 16:35
ok its an W25Q32: 32M-bit / 4M-byte (4,194,304)
Links2004/Arduino@e552d0f
Markus
@Links2004
May 05 2015 16:40
esp8266/Arduino#180
onkelfunny
@onkelfunny
May 05 2015 16:41
thank you
ficeto
@ficeto
May 05 2015 23:02
@iggr lookinah at this finction:espconn_recv_unhold/unhold
could somethingbe holding the receiving, thus not getting the ACKs