Skip to content

P214 and P215 problem #160

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

Closed
simooon442 opened this issue Oct 10, 2023 · 5 comments · Fixed by #169
Closed

P214 and P215 problem #160

simooon442 opened this issue Oct 10, 2023 · 5 comments · Fixed by #169
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@simooon442
Copy link

simooon442 commented Oct 10, 2023

Hello.
On a custom minima pcb, I'm trying to read P214 and P215 with this code:

#include <Arduino.h>
#define INPUT_PIN BSP_IO_PORT_02_PIN_15
void setup() {
  R_IOPORT_PinCfg(NULL, INPUT_PIN, IOPORT_CFG_PORT_DIRECTION_INPUT);
  Serial.begin(115200);
}

void loop() {
  bsp_io_level_t ret;
  R_IOPORT_PinRead(NULL, INPUT_PIN, &ret);
  if(ret == BSP_IO_LEVEL_LOW) {
    Serial.println("Pin LOW");
  } else {
    Serial.println("Pin HIGH");
  }
  delay(500);
}

But without success, ports state is only LOW, unable to read high level on these ports.

But when I try to read P204 for example, then I'm able to read different level state.

My question is, is the minima bootloader take into account these two port P214 and 215?

@guurii
Copy link

guurii commented Oct 27, 2023

I am also facing the same problem. Did you find any solution?

@simooon442
Copy link
Author

I am also facing the same problem. Did you find any solution?

Hello, we solve the problem by setting parameter called "BSP_CLOCK_CFG_SUBCLOCK_POPULATED" to 0 in the bsp_cfg.h

facchinm added a commit to facchinm/ArduinoCore-renesas that referenced this issue Oct 30, 2023
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Oct 30, 2023
@maxgerhardt
Copy link
Contributor

What magic is it that turning "subclock populated" to 0 (I guess that means "no") makes specific GPIO pins work, when different GPIO pins worked fine before this? Do you have a reference to the relevant sections in the chip's manual?

@facchinm
Copy link
Member

Pins P214 and P215 are supposed to be connected to a 32k quartz in case BSP_CLOCK_CFG_SUBCLOCK_POPULATED is set to 1; the mux is probably going to prevent the pins reconfiguration afterwards (the reference manual doesn't report anything on this topic but it looks like a sensible choice)

@paulvha
Copy link
Contributor

paulvha commented Oct 31, 2023

it is explained and validated at https://forum.arduino.cc/t/custom-pcb-p214-port-reading/1176644

@per1234 per1234 added the conclusion: resolved Issue was resolved label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants