Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month ago.
Libraries
Hi, i tried use library for 6610 LCD, which works on my LPC1768, on my new Nucleo. But on Nucleo it doesnt work. No compilation error, but Nucleo doesnt work. I created new Nucleo program, import 6610 LCD library and tried this simple code:
- include "mbed.h"
- include "NokiaLCD.h"
NokiaLCD lcd(PB_1, PB_15, PB_14, PB_13, NokiaLCD::LCD6610); DigitalOut led(PA_5);
int main() { led = 1; }
When i comment NokiaLCD(...), LED shines. But when i uncomment LCD init., then is LED turned off. Am i doing something wrong, or i cant use LPCs libraries on Nucleo?
Thanks for your answer
Vojta
Question relating to:
1 Answer
10 years, 1 month ago.
I don't know if that will be the cause it hangs, but for sure issue 1 is that the LCD required the not exactly standard 9-bit SPI format, and looking at the Nucleo code, it doesn't support it:
if (bits == 8) { obj->bits = SPI_DATASIZE_8BIT; } else { obj->bits = SPI_DATASIZE_16BIT; }
However clearly instead of giving an error, it sets it as 16-bit mode. No idea why it then hangs, but for sure it isn't going to work. You can have a look at: https://mbed.org/users/jppang/code/NokiaLCD_SWSPI/, there the SPI uses bitbanged software SPI, which should work on every microcontroller. Obviously not ideal compared to hardware spi, but it should work.
Do you have any chance to debug it ? Based on you description, looks like it gets stucked somewhere in the LCD constructor. Unfortunately, I don't have any nucleo board at the moment.
Please, use syntax
<<code>> <</code>>
(each on it's own line), where you share code with us. Thanks.Regards,
posted by Martin Kojtal 27 Feb 20140xc0170
I am quite new here, so i dont know, how to debug yet. I think it is in constructor, too. Maybe its because LCD. library uses mbed.h, but Nucleo has this standard library little different from LPC...
posted by -deleted- 27 Feb 2014