Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

BUTA_1301626
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

I'm trying to draw graphics with psoc using Nextion.but I couldn't find out how. Have friends who have worked previously with the nextion?I would be glad if you help me in this regard.

0 Likes
1 Solution
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

nextion0.jpg

Archive of a simple project for PSoC Creator 4.0 On this page
PSoC5LP_NEXTION.zip

View solution in original post

17 Replies
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

nextion0.jpg

Archive of a simple project for PSoC Creator 4.0 On this page
PSoC5LP_NEXTION.zip

I looked at the file you sent. but I could not run. I connected the signal I want to see on p1[4] and p1[5]. I connected tx and rx. I installed the program on psoc. but there is no change on the nextion screen. Where can I be doing wrong?

0 Likes

Everything is a little more complicated. Nextion is a device with a program inside.

This program creates an image on the screen and serves your actions.

PSoC simply provides and receives data by communicating with this program.

The process is as follows:

I used Nextion Editor v0.53 for my display (NX4024T032_011)

In my archive you will find a program for display:    test_V053.HMI

You have to rework it for your display and upload it to your Nextion.

You will see the image on the screen.

After that you can connect the PSoC and watch it communicate with the display program.

0 Likes

I made the stages you said one by one.I see the screenshot you share on the LCD screen.

But the graphical change is not on the LCD display.

0 Likes

I loaded the display and checked it with my program (LabVIEW)

nextion baudrate = 115200 but PSoC baudrate = 230400 it seems they do not match.

hmm ... i forgot how to install baudrate in nextion (

Try changing the baudrate in PSoC to 115200

You can see messages from nextion in the UART by pressing the buttons using any terminal (I use hercules_3-2-8).
p.s. 
I downloaded and checked the project - baudrate match (115200) everything works.NE.jpg

0 Likes

I changed PSoC bits per second 115200. p1 [4] and p1 [5] have connected the signal generator. but it still does not work. what else can I do to work?

Ekran Alıntısı.JPG

IMG_20190216_164044_resized_20190216_044124490.jpg

0 Likes

The picture looks a little different (offset up). Version should remain v0.53

Let's check in parts:

send your project file for Nextion Editor * .HMI

0 Likes

This is the easiest test to test communication.

NEXTION_UART_PutString("fill 10,50,380,160,RED\xFF\xFF\xFF");      // paint the area red

CyDelay(500);

NEXTION_UART_PutString("fill 10,50,380,160,BLUE\xFF\xFF\xFF");      //paint the area BLUE

CyDelay(500);

0 Likes

My nextion editor is v0.53. I'm loading the nextion screen as *.tft not *.hmi . I see the file I downloaded on the screen.I tried the test file and the graphic file, but there is no change on the screen. did you run these files yourself? I can't find where I made a mistake.

0 Likes

Yes, I checked PSoC5LP_NEXTION_test.zip it works.

It seems you have problems with UART.

Check the      fill 10,50,150,150,RED        command on the Nextion Editor simulator

Do you have a USB-> UART_TTL converter?test.JPG

0 Likes

ı dont have a USB-> UART_TTL converter. what is the converter required for?  I am doing loading with sd card to the nextion screen.

0 Likes

You can use the USB-> UART_TTL converter to test connectivity with NEXTION and PSoC.

CY8CKIT-059 PSoC 5LP has a USB-> UART_TTL converter (P12.7 = Tx P12.6 = Rx)

For example, you should see the result of pressing the buttontest1.JPG

You can just use half of the psoc 5 board (the kitprog) to communicate between the PC and he screen for testing and programming the screen, the kitprog is a USB bridge too

The pins you select must be RX to TX and TX to RX from screen to board

I found out where the problem is.Thank you very much for your help. Finally I want to ask something.I want to draw current-voltage graph. do I use the current on the x axis?

0 Likes

maybe so:
Calculate Y for X and load the entire array at once.

can you explain this code

sprintf(test,"add 3,0,%03d\xff\xFF\xFF",128-(i>>1));  

   NEXTION_UART_PutArray( (uint8*)test, 14);

we fill the waveform component with data (127x255 pixels):

add id, ch, val \ xFF \ xFF \ xFF   - for each point from 0 to 255

id = 3 waveform component ID

ch = 0 waveform component channel

val   - simply sloping line Y = k * x () I chose 128- (i >> 1) should be in the interval (0 - 127)

sprintf inserts the value val in the form of three digits in the range 000 - 127

for example:   add 3,0,123\xFF\xFF\xFF