Character LCD Display in the Presense SDK Environment

Asked 2 years ago, Updated 2 years ago, 57 views

I try to display characters on the character LCD with I2C connection in the Spresense SDK environment, but I can't find any programming material or precedent.Even if there is no example of the source code itself, it would be nice to know what to call at least, but does anyone know?

October 29th
Additional
I've already found an example LCD display on arduino, but I'm stuck with the conversion between arduino and the Supresense SDK (I'm wandering around looking for the SDK library).I also tried to measure the temperature using LMT01 LPG, but arduino didn't know how to turn off the chattering filter on GPIO input.This is the first time I've ever programmed a microcomputer board like this, and I honestly don't really understand the arduino itself.I'm sorry.

October 30th Additional
In SDK environments, I found that I2C ports are selected and configured separately from the source file in kernel configuration and SDK configuration, not on the source code, and pcf8574_lcd_backpack.h is available as the character LCD driver for I2C connection."Also, the ""pcf8574_lcd_backpack.txt"" had some usage instructions."However, I still don't understand the detailed usage.If you have used it, could you give me some advice?

November 10th Additional
Attempting to use the LCD driver "pcf8574_lcd_backpack.h" causes kernel panic and stops working.While investigating the cause, we found that the device path (for example, "/dev/lcd0") could not be generated.It seems that the lcd device needs to be initialized, but I don't know which command is required.Does anyone know?At this stage
intboard_i2cdev_initialize(void);
FAR structure lcd_dev_s*board_lcd_getdev(intlcddev);
Should I use ?I understand that, but I don't understand how to use it.

spresense

2022-09-29 21:51

2 Answers

I also had Akizuki ACM0802C-NLW-BBW-IIC, so
I tried to find out what to do with the LCD display in Spresense.

"The ""pcf8574_lcd_backpack.h"" does not appear to be the affected driver…

"

I made it myself, so
I uploaded it to github.

https://github.com/tttk-prj/spresense.git


in this repository examples/lcd_test
I have put the LCD driver and the code using it in the folder

How do I build this repository when I clone it?

$cdspresense/sdk/
 $ ./tools/config.py-k release
 $ make buildkernel
 $ ./tools/config.py-d../examples/lcd_test lcd_test
 $ make
 $ ./tools/flash.sh-c/dev/ttyUSB0-b1152000nuttx.spk

Write nuttx.spk to the device as .
(The point is to specify lcd_test-defconfig in the examples/lcd_test using the "-d" option in the config.)

After that, connect it to the USB port on the main board of the spresense with terminal software.

nsh>lcd_test

displays the LCD.(It should be...)

The HW connection should be connected to the

ACM0802C-NLW-BBW-IIC-side 10-pin pin numbers ACM_01 to ACM_10,
For the Spresense side, the pin name mentioned in https://developer.sony.com/develop/spresense/docs/introduction_ja.html is

ACM_01(Vss)<->GND
ACM_02(Vdd)<->VOUT
ACM_03(V0)<->GND
ACM_04(SA1)<->D09(PWM2)
ACM_05(SA0)<->D08(SPI2_MISO)
ACM_06(SDA)<->D14(I2C0_BDT)
ACM_07(SCL)<->D15(I2C0_BCK)
ACM_08(NC)<->NC
ACM_09(BL+)<->EXT_VDD(Main Board)
ACM_10(BL-)<->GND

Yes.
SA0 and SA1 connect to D08, D09, LOW on the program, and set the device address to 0x78.

By the way,
It seems that this LCD display is not compatible with Spresense.

https://developer.sony.com/develop/spresense/docs/hw_docs_ja.html#_ Digital Signal uartspipwmgpio on Expansion Boards

I was fascinated by the phenomenon described in this note...

The ACK phase of the I2C does not seem to recognize the ACK (LOW).
There was an instruction to buffer the external to resolve it.
I didn't have it and it was troublesome even if I had it, so
In the code posted to the repository, the software emulates the I2C and
Also, I ignored the ACK phase and forced the command to be displayed...

I have included the code so that I2C master of hardware can be used.
To enable the hardware, once you have built it,

$make menuconfig

in
Examples ->Test driver of ACM0802C-NLW-BBW-IIC
in
UUse Spresense HWIIC peripheral <
If you enable , you should be able to do it.

I hope the above will be helpful...


2022-09-29 21:51

Wouldn't the article on the Wireless library character LCD be helpful?

When you have time to spare, read the series "Starting with L-Chika in Spresense" from (1) to learn a lot of knowledge and improve your programming skills in Spresense.


2022-09-29 21:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.