Problem PSoC Creator CY8CKIT-042

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

cross mob
Anonymous
Not applicable

Hello,

   

I have a big problem with PSoC Creator. I want to program my CY8CKIT-042 to be able to use it with an alphanumeric LCD, LED and switches, but I know absolutely nothing about all the creation of the project. All I want is to write a code and build it in the card, but I can't. Is there a way to only write the code without creating some project ? Also, when I want to integrate a header file, it says that the file is untraceable, is that a problem from the installation ? I hope that you will help me because I must do it before the 15 January. Thanks for reading.

0 Likes
44 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

No, you need a project. You can start by looking at the example projects that come with Creator.

   

I recommend looking at the PSoC Creator 101 videos / tutorials: http://www.cypress.com/video-library/PSoC-Software?tid=38161

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

Alex, relax!

   

You have still 10 days left, you could do your project within two days (as a beginner) and write the documentation within the next week.

   

PSoC projects are easy to build, just (as shown in the videos hli pointed you at) drop your needed components onto the topdesign, adjust them by setting the properties and connect them with wires to the pins. Remember that the datasheet for any component is just a mouse click away, do read (and understand) them!

   

When you got stuck, don't hesitate to further as us, attach a workspace bundle to your  post (Creator -> File -> Create Workspace Bundle) and we will help you asap.

   

Btw: What kind of LCD have you got? Interface, lines, columns? Compatible with Hitachi HD44780? Link to datasheet

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hello !

   

First, thank you for your quick answer. I've read some documentations, but they're all in English and it's not my native language. I don't think I'm that bad in English but reading something that isn't your native language all day is very tiring because I must focus to understand the maximum. The LCD is one the DOG series from Electronic Assembly, the EA DOGM162-A with 16 columns and 2 lines.

   

Here's the datasheet : http://www.lcd-module.com/eng/pdf/doma/dog-me.pdf.

   

I'm really a beginner with Cypress, before I used a Arduino UNO Rev 3 in class so I made an Arduino code for what I want to do with the LCD but it's not compatible with Cypress... So, I created a project but when I open "main.c" it told me that "project.h" can't be found. No matter how many times I install PSoC Creator, I've always problems with the libraries.

   

I'll wait for your answers.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

'project.h' is created when you build the project for the first time - it contains the reference to all the hardware that you have in your schematics.

   

To move over your code from Arduino to PSoC depends on the interface mode. For 8/4-bit modes, create a control register in your schematic, which you can use just like pin/ports on an Arduino. There are APIs for writing the register in one go, or you can adress single pins.

   

If you are using SPI, add a SPI master to your schematic and use its API. Or you use a control register and do bit-banging.

   

Apart from these differences the code should be quite easy to migrate.

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

The file project.h will be generated automatically when you build your project (Creator->Build->Build your project). You should follow the videos where that is shown.

   

Your LCD does not have a HD44780 chip, so you will have to program everything yourself (without using an LCD component).

   

In the datasheet you provided is no initialization shown for a 4-bit interface which would require fewer pins, so you will need an 8-bit data port and a 3-bit control port as interface. There is a pin-component which you can use for that, look into the board's schematic for pins already used (LEDs, switches, care for polarity) which is installed on your disk when you installed the files for the CY8CKIT-042.

   

There are many example projects (simple ones and complicated): at Creator Start page under Examples and Kits -> Kits you will find them, under Find Example Project there is another bunch.

   

 

   

Bob

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

So, I've done what I could about the components dropping but I don't know if it's correct, I'm at the lesson 7.  I want to know your opinion about it if you accept. I've put a schema of the circuit made on Isis but the real will be with the Cypress instead of the Arduino and the correct LCD. And when I try to build "TopDesign.cysch", I have an error but I don't know why.

   

I'm waiting for your answers.

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

The LCD component might not work for you, use pure pin-IO as I indicated in attached project.

   

You do not want to shortcut your switches, the wires in the schematic are "true" wires, so read the pins directly

   

Change the sw-pins from "High impedance" to "Pull Up" or the pin will be floating while the switch is not pressed (I changed one of the pins to show how. Examples on how to read and write pins are attached.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Well... I'd love to want to thank you but I can't open the "TopDesign" file, so I don't know what you've done.

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

Well, this is something I cannot help you with. I just downloaded and expanded the project from my post into a new folder and successfully opened the project and topdesign.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Sorry to ask you that after all you've done, but can you take some screenshot about what you've done in "TopDesign" or explain it to me ? Because as I am right now, I'm really stuck because of that and also because I don't know how to initialize the LCD because until now I've only used 3x7 segments display.

   

EDIT : It's OK, now I can open "TopDesign" it was because I was using the 3.2 version PSoC Creator so I updated it. For the initialization of the LCD, I've found something in the datasheet page 7, but I still don't understand and because there are hexadecimal, isn't that for BASIC ?

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

Hexadecimal has nothing to do with a programming language (BASIC, C or PASCAL) but is used to represent in a more readable form the representation of numbers in the binary world of computers.

   

TAKE CARE: The schematic you supplied shows only a four-bit interface which your LCD module supports, but in the datasheet no initialization for a 4-bit wide data bus is shown.

   

A test:

   

There is a Character LCD component (which you already put on your topdesign)

   

Try it by connecting the module to port 1[0..6] (see datasheet for the pin functions page 14)

   

in main() you may use

   

LCD_Start();

   

LCD_PrintString("Hello World!");

   

while(1);   // Stop here

   

This might work for your LCD.

   

 

   

Bob

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

I was wondering about the hexadecimal because when I was doing some codes on BASIC for same project before they told to use a Cypress, I saw hexadecimal numbers in some ".bas" file.

   

I will try, but the LCD have 20 pins in total with at least 3 to the ground, 10 connected together with I don't know what, 5 whom I think are connected to the Cypress and 2 floating. That the picture inside the archive.

   

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

The LCD module has exactly 14 pins and none of them is floating. Stick to the schematic you supplied and not to pictures which only show part of one side of the story. Some more pins of your PCB are for the switches. Did you already change the drive mode of the pins as I suggested? Did you manage to read a switch?? Are you using the debugger to see if you can access the switches???

   

Can we see your latest elaborate?

   

 

   

Bob

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

I know that some of the silver ink wires are for switches and LEDs, but I was talking about the LCD not the PCB. But because I've never used an alphanumeric LCD before except on Isis, I don't really know the "real" connection of the LCD. What I was talking about is the pins on the top of the DOGM162 (look at the picture inside the archive).
For the moment, I use a breadboard before putting everything on the PCB and I'm trying to make a LED blink (that's the project inside the archive) but when I assign a port for the pin of the LED and that I build and program, nothing happened. I was wondering if the pin I connect between the LED and the pin of the Cypress does matter because I've tried by connecting to the "P2_5" port after I assigned the "Pin_LED" to "P0[4]" on the CY8C4245AXI-483 44-TQFP. Is there a specific port at which I must connect the LED and where's the port for GND and VDD because I think I found it on the paper with the Cypress but there's absolutely nothing when I connect it to the breadboard.

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

You are not working with a CY8C4245AXI-483 44-TQFP chip alone, you have got a complete board with some hardware already on it. Under Programs(x86)\Cypress\ you will find all your successfully installed kits, under documentation\hardware are the schematics (as pdf). You will see, which pins are dedicated to board-internal hardware as the accelerometer, themperature measure etc. These pins will not be available for your experiments. There are already two switches on the board, but you probably may connect your module's switches in parallel.

   

The accompanied material in the kit's documentation show precicely the GND ports and all the other signals brought out to the connectors. Just read it.

   

 

   

Bob

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

Even for just a LED blinking I'm not working on a a CY8C4245AXI-483 44-TQFP chip alone ? Because the lessons only show how to use the things already on the Cypress. No matter how much I've searched on Internet, every time I found a tutorial for blinking a LED, it was for the LED on the Cypress but I want to do it with an external LED. I looked at the "Pin Assignment Table" section inside the "CY8CKIT-042_Kit_Guide.pdf" like you told me to do but it didn't help me at all. I've tried to assign a port to the LED according to the "Pin Assignment Table" (I've put the LED to the port P2[6] so according to the document it's D8) but when I connect the cathode to D8 with everything correct at the anode, nothing happened.

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

Change the drive-mode of your pin2_6 to "Strong", then it will be able to drive an LED.

   

 

   

Bob

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

Thank you so much ! I owe you so much ! One question : now, I'll add a switch to light the LED, but in the brackets after the "if", I can't write "(Pin_SWI_0 = 1)" I must write "= =", but in my few knowledge about the language C, "= =" isn't to say high or low state, and do I have to put the drive mode of the input pin in "strong drive" too ? I know I look like someone who know absolutely nothing but usually, I'm way better than that ^^ I'm really starting to stress because Friday will come really quickly and I still don't know how to initialize that damn DOGM162 LCD in 8 bits mode SPI. I've found some initialization for the LCD but (I'm not sure) I think it's not in SPI (http://www.lcd-module.com/support/application-note.html). Anyway, I've made a giant jump thanks to you.

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

A switch is usually connected between pin and GND (for security reasons). When you set the drive mode of the input pin to "Resistive pull-up" and "initially High" you will get for Pin_SWI_0_Read() as result a 1 when SW not pressed and a 0 when  SW pressed. so your if could read as

   

if(!Pin_SWI_0_Read()) {  // Switch pressed

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks ! I've been wondering something, last week you said that the EA DOGM162 does not have a HD44780 chip, but it have a ST7036 chip integrated, and in the datasheet (http://www.lcd-module.de/eng/pdf/zubehoer/st7036.pdf), it says (page 1, right column) "Instruction compatible to ST7066U and KS0066U and HD44780". So, do I still have to program and initialize all by myself ? If yes, I looked again at the "programme clavier" archive you gave me and I understood that the four "LCD_Data" Pins with "LCD_RS" and "LCD_E" are the same that the pins of the LCD component, but if I must use this method, how I am supposed to print something on the LCD ? I hope that with that new information, it will simplify the task.

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

As I already pointed to: Drop a Character LCD on the topdesign, build the project, check which port was assigned to LDC (change port if you need to).

   

Open the Character LCD Datasheet (right click on the component and select Open Datasheet) and look for the APIs (LCD_PrintString() etc..)

   

Look at my post from Januara 7th

   

 

   

Bob

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

Yeah, I already tried it but it didn't work. Maybe it's because I didn't initialize it or my connection isn't good, but nothing appears on the LCD. What I said about initialization in the datasheet but I don't know how to write it in the code so I took a screenshot and put it inside the archive, what I use to the connection of the LCD on the breadboard and finally here's the pins with their function are inside the archive too.

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

Alex, I already told you that the initializations in the datasheet do not show for 4-bit databus, only for 8-bit.

   

Follow consequently my advices, do not initialize the component yourself, but use LCD_Start().

   

Post your project when not working as expected,

   

 

   

Bob

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

I'm really sorry, I'm stressing so much, I want to progress really quickly because there's only 3 days left with today so I read too quickly ^^'. There's something that bother me with the LCD component, when we assign the port in the ".cydwr" file, we must chose 6 pins from a certain order and I chose "P2[6:0]" but "P2_6" is a bit far from the 6 others. And for the pin "RW", on the "connection LCD 5V 4 bit" picture, this pins is connected to the Cypress but I connected it on the ground like I did on Isis. On the picture "pins-symbols-function", the pin 21 correspond the pin at the left of the picture "breadboard connection".

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

There is another component where the pins are not bound to be on one port, but there have been troubles with the latest revision afaik. Stick to port2 and make a nicely configured cable bunch.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I'm sorry, I don't understand what you mean. Are there some wires not connected to the right spot ? 

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

I was referring to your complain "There's something that bother me with the LCD component, when we assign the port in the ".cydwr" file, we must chose 6 pins from a certain order and I chose "P2[6:0]" but "P2_6" is a bit far from the 6 others. "

   

"And for the pin "RW", on the "connection LCD 5V 4 bit" picture, this pins is connected to the Cypress but I connected it on the ground like I did on Isis" RW pin is needed for status (LCD_Char_1_IsReady) checking, so do not connect it with GND.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

I wonder why, but before, when I was connecting "R/W" to the GND, I already had 7 pins (without counting +5V and GND) to the Cypress and now that I connect "R/W" to P2_6, I still have 7 pins used. So, right now, my connections are :

   

pin 21 (CAP1N): floating ; pin 22 (CAP1P) : floating ; pin 23 (PSB) : +5V ; pin 24 (VOUT) : +5V ; pin 25 (VIN) : +5V; pin 26 (VDD) : +5V;  pin 27 (VSS) : GND ; pin 28 (D7) : P2_0 ; pin 29 (D6) : P2_1 ; pin 30 (D5) : P2_2 ; pin 31 (D4) : P2_3 ; pin 32 (D3) : GND ; pin 33 (D2) : GND ; pin 34 (D1) : GND ; pin 35 (D0) : GND ; pin 36 (E) : P2_4 ; pin 37 (R/W) : P2_5 ; pin 38 (CSB) : GND ; pin 39 (RS) : P2_6 ; pin 40 (RESET) : +5V.

   

I've tried with exactly the same project I send to you before and there's still nothing on the LCD.

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

Sorry, but I cannot follow your list. What you are meaning with

   

 pin 35 (D0) : GND ;

   

The needed connections are quite clearly stated in the Character LCD Component's datasheet.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 According to the page 14 of the Character LCD Component's datasheet, I have to use D0 to D3 and not D4 to D7 ? But, according to the datasheet of the DOGM162 page 4, I have to use the pins D4 to D7.

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

Well, that exactly shows that the Character LCD component is not compatible to your LCD device. Sorry

   

Plan  B

   

Get asap the initialization sequence for a 4-bit interface for your LCD. Wasn't listed in my datasheet.

   

The connections you made between the breadboard and the -042 Pioneer do not look very safe.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Crap... What do you mean by saying that my connection doesn't look very safe ?

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

I (personally) would have confected a cable with plugs at the end and bound the wires so that i get a wiring harness.

   

What's the initialization sequence? (link)

   

 

   

Bob

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

One issue I can see on your photo's is the jumper J9 is set for 3.2 v not 5.0v that your LCD requires. Also I don't think you have the LCD wiring correct check it again and don't ground r/w signal hook it up. Also port 2 is for analog and should not be used for digital signals. I use port 0 or 1 for LCD's

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is a program that uses a different LCD character library you can use any port in any order.  Also on the topdesign page is a schematic on hooking it up on the Pioneer board connectors.

0 Likes
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

I was looking at the text in the top design and it was for a Psoc 4M board and not a Psoc 4 Pioneer so I have updated the text.

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

I've found two initialization sequence but I don't have really good hopes in them when I saw them but maybe... I put them in Attachments. Thanks bobgoar, but I didn't used the jumper J9 ? What do you mean by hooking up r/w ? On your schematic, r/w is connected to the ground. I'll try your project and I'll give you an answers right after I tested it.

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

When I try to program, it tells me that there are 14 errors. If I understood correctly the errors say that the "Char LCDmp" pins aren't connected.

0 Likes
Anonymous
Not applicable

Well, I have successfully programmed the Cypress that time, but still nothing on the LCD... 

0 Likes