Adding LCD library for PROC BLE

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi All,

   

I am trying to develop (16*2) LCD library for Proc BLE, I am using multiport character LCD which is not supported by the device.

   

 

   

Hence I would like to have initial help required for building the library

0 Likes
27 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum.

   

Start with the generated filed for the Character LCD component. When everything runs smoothly, take a deeper look into the "Components Author Guide"  (Start -> Cypress -> PSoC Creator 4.0 -> Component Development Kit ->) to see how a component is made.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi,

   

I have custom board for PROC BLE (CYBLE012012-10) which has multiple port connected to LCD pins, but when I create the project with the above mention device it gives me error charLCDmp not compatible with the device.

   

So I thought of creating my own library file LCD.h, and add dependencies for this library in my application project.

   

But my doubt is for other device we have multiple port LCD and we connect respective GPIO pins so how I should do this connection in my application project

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

"charLCDmp not compatible with the device" The Char LCDmp component needs a Control Register component which is not available in your selected device. I would suggest you to use the CharLCD component and free a complete port for the LCD connection.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi,

   

Since my LCD is connected as such

   

D4----P2.6

   

D5----P2.4

   

D6----P2.3

   

D7----P2.2

   

E-----P1.6

   

RS-----P1.5

   

So in these case how shall I use charLCD, Can i make these connection from software level also instead of doing from schematics

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

CharLCD connects all signals to a single port so your P2/P1 mix will not work. The CharLCDmp component needs to use a control register which your selected chip hasn't got, so this will not work too.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Ya I too knew this, But whats the solution for above problem

   

How to proceed further

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Use an LCD that has got an I2C interface.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi, 

   

Can I create a LED blink project without using any GPIO Port output component in Topdesign.cysch file.

   

Every configuration will be done from software side.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Why should you? Read the "Registrer TRM"

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi,

   

As mentioned in my earlier post I have Proc BLE custom board with 16*2 LCD mapped to multiple ports. The Proc ble doesnot support

   

multiple port LCD. There is no option for I2C support LCD from the h/w also.

   

Hence it was suggested to create your own custom LCD library and include LCD.h in the application project

   

There will be no drag and drop component in topdesign.cysch file,Same I did but nothing is displayed on the LCD.

   

Any example project from your side will be of great help.Is it really posble to create a project without using any predefined components

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

"Is it really possible to create a project without using any predefined components" This is not the problem. You may place pin components on your topdesign and program those to access your LCD. When you create a new project for a CY8C42xx you will get some generated files which you can copy and modify them accordingly to your project. At least initialization techniqes, required delays etc will be quite helpful, but this might be a job that will take a few days. Get an 8 channel logic analyzer, so you are not left alone with a work / doesn't work decision.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

Thanks for your reply. As per your suggestion I should place pin component in the topdesign and program it accordingly.But how should I connect pins without using LCD component. Can you share me any example schematic so that I will program it accordingly.It will be a great help from your side

0 Likes
Anonymous
Not applicable

If I create a lcd project for CY42X I have few generated files like LCD.c,LCD.h according to topdesign.When I use same files in my project for CYBLE012012 so do I have to do anything in topdesign file or it will be empty

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You can remove the "Hardware Connection" from a pin and program its state in software using Pin_Write() API.

   

This will be the only remaining way for you to connect an LCD to your PSoC module. You will need 7 pins: D4..D7, E, RS and R/!W

   

Not a quite easy job, but will be doable. Get an 8 channel logic analyzer

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Any example code from your side so that I can take it as reference

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

See in attached project how to access pins.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi Bob,

   

I created project as discussed above, I can see some junk letters on the lcd. Can you just checkout in the project if any wrong initialization is being done

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your code in LCD.c

   

    LCD_PORT_DR_REG |= (nibble);

   


will not work when the pins are on different ports or non-consecutive. You will have to set the D4 to D7 pins one by one yourself. Use a function for that, it appeard more than once in the code. Check for (I didn't) other port accesses in the code.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Ya I changed it

   

   D4_Write (nibble >> 0);           
    D5_Write (nibble >> 1);
    D6_Write (nibble >> 2);
    D7_Write (nibble >> 3);

   

But still junk is there,I am still doing something wrong

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

What I see is that you loop in main() without delay writing to LCD.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob

   

I am able to see proper string on the LCD but one small issue is there when I powercycle the LCD its blank again

   

Why is it so?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

LCD stores information in ram, a power cycle will erase all information. Same for the PSoC, power cycling will re-initialize LCD.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Power cycle the LCD will make it blank this is understood,but when I power cycle my device (CYBLE012012-10) then also LCD is blank

   

I need to program it once again to see the print .

   

But this issue is not observed when I test with CY84247LQI-483

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

As I said before: Same for the PSoC, power cycling will re-initialize LCD component by your program. This will clear the LDC.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 When I power cycle the board then it should re-initialize the LCD with my code and I should be able to see the print

   

But its not happening. The LCD seems to be blank

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your LCD initialization seems to fail. Check the initial states of your control signals (RW/E) for unwanted activities during power cycle. Use a scope or a logic analyzer.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi,

   

How do I change BLE device name? I have tried below two steps

   

1) Change: GAP Settings > General > Device name 

   

2) GAP Settings > Advertisement Packet > Check "Local Name"

   

 

   

But Still I am not able to change it

0 Likes