NEXTION - PIC16F877A

Jtomas

New Member
Hello everyone,
I'm glad I found this site, I would appreciate if someone has made a connection between a Nextion screen and a PIC, using PIC SIMULATOR IDE, I'm stuck and I'm not able to capture the codes of the buttons that I've entered on the NEXTION screen from the PIC. I'm able to send data from the PIC to the Nextion but not the other way around. I'd appreciate some help.
Thank you very much.
 
Thanks Dogflu66,
I entered the function and it worked, I left the UART initialization at 1000ms. because I had already tried to modify it without obtaining good results.

Thank you very much.
 
Hello,
Do you have a solution for this problem? I would not be interested in creating a function to represent the messages sent to the Nextion Screen, I only have a String variable declared.
Thanks.
 

Attachments

  • Captura de pantalla 2024-10-12 010823.png
    10.6 KB · Views: 12
  • LOOP_CAT_v1_11102024.bas
    7.5 KB · Views: 10
Too many strings... Ask yourself if you need all the strings.

put strings into CODE space and pull them one by one when you need them.

read the code byte by byte and fill strings when needed... microcontrollers are never really ram abundant.. compromises are needed.

DogFlu66 I can't seem to see a way of storing constants.. Come of Vlad using code space would be an ideal instead of using up data space
 
I don't know what you mean, I have compiled the program you left and it is both in RAM and in flash under 40% in use and it doesn't give me any error. I recommend that you update the IDE because the strings have been greatly improved. Variables can be saved in flash in several ways, the simplest is to declare them with Const.

'TxT
Const Tex1 = "BANDA..."
Const Tex2 = "t2.txt="
Const Tex3 = "POSICIONANT..."
Const Tex4 = "ÿÿÿ"

'Motor position at end of stroke

'ms_Nextion
value = Qt + "" + Qt
value = Qt + Tex3 + Qt
UART_Write Tex2, value, Tex4
WaitMs 200
 

Attachments

  • v968.jpg
    77.6 KB · Views: 9
Hello,

Due to insufficient memory on the PIC16F877A I have switched to the PIC18F4520 and the programmer I used until now, the K150, gives me an error. I have been googling and if I am not mistaken it does not support this type of PIC, although the software recognises them but gives an error when recording. Is there a solution to this? Or should I consider purchasing a programmer for this type of PIC? If so, see if you can advise me.

I am attaching a screenshot of the error.

Thanks.
 

Attachments

  • Captura de pantalla 2024-10-15 232251.png
    79.4 KB · Views: 2
Do you have enough money for an XGecu TL866II ? I find this cheap programmer one of the best.. It can do Soooo many devices, You can get them for as little as £30..

As for the K150.. Seeing as the pic18F2520 is on the list just select that.. Its the same chip.
The error you see is an EEprom error.. Can you dissable the writing to eeprom?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…