PiotrSperka / ESP8266-WebRadio

SHOUTcast (webradio) player based on ESP8266, VS1053 and AVR (for UI)
47 stars 21 forks source link

PCB and extra ram #9

Open karawin opened 8 years ago

karawin commented 8 years ago

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)

PiotrSperka commented 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

karawin commented 8 years ago

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.

karawin commented 8 years ago

I will try GPIO9 or 10 ..... Oups, no.

karawin commented 8 years ago

That will do the trick. Strange: the blue led on esp blink according to GPIO2 state.

define GPIO2 2

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.

karawin commented 8 years ago

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.

karawin commented 8 years ago

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); }