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

Fix SPI + MPU #31

Open
Peque opened this issue Apr 7, 2019 · 1 comment
Open

Fix SPI + MPU #31

Peque opened this issue Apr 7, 2019 · 1 comment
Labels
Milestone

Comments

@Peque
Copy link
Member

Peque commented Apr 7, 2019

MPU is currently not responding for unknown reasons. We should investigate this further.

Also, SPI communications seem to be broken and require some wait time before reading/writing:

diff --git a/src/platform.c b/src/platform.c
index 6776f13..f9472a7 100644
--- a/src/platform.c
+++ b/src/platform.c
@@ -74,6 +74,7 @@ uint8_t mpu_read_register(uint8_t address)
        spi_send(SPI3, 0x00);
        reading = spi_read(SPI3);
        gpio_set(GPIOA, GPIO15);
+       sleep_us(4);
 
        return reading;
 }
@@ -92,6 +93,7 @@ void mpu_write_register(uint8_t address, uint8_t value)
        spi_send(SPI3, value);
        spi_read(SPI3);
        gpio_set(GPIOA, GPIO15);
+       sleep_us(4);
 }
 
 /**

That was not the case with Bulebule. Why did it change? Could we use hardware chip-select?

@Peque Peque added the bug label Apr 7, 2019
@Peque Peque added this to the Portugal 2019 milestone Apr 7, 2019
@Peque
Copy link
Member Author

Peque commented Oct 24, 2019

Hardware chip-select would be enabled in next PCB batch (if ever...): #41

@Peque Peque modified the milestones: Portugal 2019, Portugal 2020 Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant