Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCB and extra ram #9

Open
karawin opened this issue Jun 18, 2016 · 6 comments
Open

PCB and extra ram #9

karawin opened this issue Jun 18, 2016 · 6 comments

Comments

@karawin
Copy link

karawin commented Jun 18, 2016

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
Copy link
Owner

PiotrSperka commented Jun 18, 2016

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
Copy link
Author

karawin commented Jun 18, 2016

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 karawin closed this as completed Jun 18, 2016
@karawin
Copy link
Author

karawin commented Jun 18, 2016

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

@karawin
Copy link
Author

karawin commented Jun 18, 2016

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 karawin reopened this Jun 18, 2016
@karawin karawin closed this as completed Jun 18, 2016
@karawin
Copy link
Author

karawin commented Jun 18, 2016

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 karawin reopened this Jun 18, 2016
@karawin
Copy link
Author

karawin commented Jun 18, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants