Open karawin opened 8 years ago
Hi,
I made these labels based on labels on my module's PCB. I haven't used that pin, because I had some trouble with driving it. If there was a mistake on PCB's labels this could be the reason. I need to check that. If you can drive this pin (GPIO1 or GPIO2), there is no problem using it as CS for the ram. The only thing to do is to rewire this one pin on PCB and review extram.c file.
Best regards, Piotr Sperka
Thanks for the answer. I will see with http://www.forward.com.au/pfod/ESP8266/GPIOpins/index.html to test it. Congratulations for your good work.
I will try GPIO9 or 10 ..... Oups, no.
That will do the trick. Strange: the blue led on esp blink according to GPIO2 state.
void ICACHE_FLASH_ATTR gpio2_output_conf(void) { PIN_DIR_OUTPUT = (1<<GPIO2); }
void ICACHE_FLASH_ATTR gpio2_output_set(uint8 value) { if(value == 0) PIN_OUT_CLEAR = (1<<GPIO2); else PIN_OUT_SET = (1<<GPIO2); }
What about an automatic detection of the external ram? Just a simple test at init and a flag. And of course, a malloc in place of the static buffer.
Finally, i keep the test task and the blue and external led blink because i like it ;-) but i move it to GPIO2. And GPIO16 for the cs of the external ram.
According to https://github.com/esp8266/esp8266-wiki/wiki/gpio-registers No need to |= in ICACHE_FLASH_ATTR void ControlReset(uint8_t State){ if(State) PIN_OUT_CLEAR = (1<<RST_PIN); else PIN_OUT_SET = (1<<RST_PIN); }
ICACHE_FLASH_ATTR void SCI_ChipSelect(uint8_t State){ if(State) PIN_OUT_CLEAR = (1<<CS_PIN); else PIN_OUT_SET = (1<<CS_PIN); }
ICACHE_FLASH_ATTR void SDI_ChipSelect(uint8_t State){ if(State) PIN_OUT_CLEAR = (1<<XDCS_PIN); else PIN_OUT_SET = (1<<XDCS_PIN); }
Hi PiotSperka,
I think that there is a mistake on the Eeschema: U4 pin 11 is labelled GPIO1, I think it is GPIO2.
Why not using this one as CS for the ram? This will let GPIO16 free for an optional led indicator?
Thanks JP (KaraWin)