I got it working, but it’s painfully slow when I upload the code with the “mbed-enabled” board and still slow when I do it using the “standard”-board uploader from Arduino Studio.
It runs half the framerate of what I see in the demos in the videos, I would say.
I think the XIAO should be capable enough, so is there anything that needs to be set on the XIAO to enable higher speed?
I used the pins as follows:
D10 for MOSI
D8 for SCK
D4 for SS/CS
I am using the provided example-code (sharpmemtest)
ok so I debugged this the whole day now and by accident I discovered that it’s perfectly fine when using board → Seeed nrf52 boards but is slow as hell when I use board → Seed nrf52 mbed-enabled boards
…
which I think I have to use because I need to use ArduinoBLE which gives me a compile error on the non-BLE variant:
library ArduinoBLE claims to run on samd, megaavr, mbed, apollo3, mbed_nano, mbed_portenta, mbed_nicla, esp32 architecture(s) and may be incompatible with your current board which runs on nrf52 architecture(s).
'SerialHCI' was not declared in this scope; did you mean 'Serial'
2.Can you increase the clock frequency which is 2MHz by default? XIAO nRF54820 can be increased up to 8MHz, but I don’t know if a Sharp allows up to what MHz.
I do not have a Sharp, so I can only check up to the compilation.
@msfujino thanks for the idea, but it’s not updating the display at all with your hardware spi - code. Instead, last image from last soft-SPI call is shown.
I tried with different clock frequencies already with no big changes.
By “slow” refresh I’m talking about ca. 3Hz (!) for a rectangle and a random number while no other code is executed but the display refresh.
Sorry: it’s running perfectly fine with your HW-SPI suggestion, when NOT using mbed. With mbed = no updates whatsoever to the screen.
it’s actually running super fast and smooth with Adafruit_SharpMem display(&SPI, D4, 400, 240, 8000000); in non-mbed-mode but doesn’t do anything when I flash the same code in mbed…
I ran an OLED(SSD1306) instead of a SharpMemDisplay to check the waveforms. Both clock frequencies are 8MHz, but the interval between one data transfer and the next is 20uS for mbed, while non-mbed is 6uS. The throughput is very different. The mbed’s SPI has poor performance.
There is another big difference in the waveforms: The mbed clock pins are set to “low power”, so the waveforms are not properly square. The non-mbed pins are set to “high power”, so they are properly square. This is just a guess, it may be that the Sharp input pins do not accept the mbed waveform.
I think there is a way to switch the pin setting to high power, but I don’t think it is easy.
and this cannot be easily changed?
I just need a working prototype, and the display I used first is completely unreadable in sunlight which is the only usecase for this application… so I thought “let’s switch to a new display, can’t be that hard”
I think there is a way to switch the pin setting to high power, but I don’t think it is easy.
If anyone has any expertise in this area、we would like some help.