Start a new topic

RTC registers

What are the RTC registers and what is the data format of the value ?
Where is a description of the data in each register ?
How is the data read from the register ; BCD or Hex ?
Where you have a full documentation for the RTC?
Thank you

Patrick,
Let,s make it clear once for all.
All i asked on the ticket was a proper "data sheet" how to use the product.
I spent 200 dollars buying two 7" screens. One resistive and one capacitive touch. Both of them enhanced model. I want to use them.
Every electronic product when you buy it has a data sheet. Even a resistor, diode or capacitor, not talking microprocessors or other complex IC.
Where do you think i can learn how to use them ?
If i go on the forums, you accuse me that i am stealing the code. But if i do not have a data sheet i cannot write my own code.
This product is meant to be mostly a display to show the status of a variable, which is a result of my microprocessor logic (i do not use Arduino and i use Microchip processors.)
Assuming i press a button, how my micro will collect that information ?
Then, during the process, i want to change the status of that button and turn it OFF, what command i should send to the screen from the microprocessor ?
All these , for regular products are explained on the data sheet. But no data sheet for the screens.
Just a generic WIKI and a generic command list.
The syntax commands sent or received it is not described.
It is just a brief example.
In exchange, for Microchip at least, for a tri-state pin, you get the full description how to use it and the TRIS meaning.
Asking a full description of RTC is part of the tech support or sale and not of the forum.
Look on the attached data sheet from Microchip for pic18F87K90 on chapter 17, page 217.
It is a full chapter on the internal RTC on the micro, including how data is stored, read, type of the data and so on. That i expect from ITEAD tech support . Just a simple data sheet.
 




 

pdf

The Nextion HMI Solutions page is accessed via

  Help menuitem of the Help Menu within the Nextion Editor.

  -  this launches in the web browser.

  -  from here the most important links and sublinks are listed.


The RTC does not have direct component user access per se

  - Nextion firmware remains a closed source HMI product

    just the same as iPhone doesn't make docs in Microchip format.

  - there is no such datasheet available for the

      which RTC, GPIO, EEPROM, MCU, or proprietary display used


The Nextion does have a growing list of available commands

  - these commands have begun evolving into a pseudo language

    and not really a language per se, but certainly order of commands

    produces varied results - just as normal programming does.


All available commands and explanations - Nextion Instruction Set.

How to arrange them is indeed a form of coding.


As an HMI product touch is sent to user side MCU

 - user can process press/release events as needed by user MCU

 - more advanced some logic can be device side


The available resources to learn are found in

   - the Nextion HMI Solutions page

     - the sub links of the Nextion HMI Solutions page.

  - here the Instruction set will be found command / descriptions

  - tutorial with example code

  - an Arduino Library (good as framework for any other)

  - links to next most important items in learning


Help menuitem of the Help Menu in Nextion Editor

RTC variable descriptions are in Nextion Instruction Set

The triple 0xFF termination is three times mentioned 

    in the Nextion Instruction Set (most important page)

 - quick accessed via Search Bar "Nextion Instruction Set"


The firmware has made simple text of RTC without having to

   go through Datasheets of RTCs and STM32s

   simple text, no parameters - just use variable and good.


There is no accusations of any stealing of code

  - the debate was using hobbyists to debug for commercial code


That thread had two full RTC examples

   a basic example in full code using if statements

      - code in full view on thread

   an advanced example using the b[id] component array

      - instructions in full view and included working HMI file

When your code failed,

   - you did not follow the directions as posted

   - you did not compare to the testRTC.HMI working code

   - I stated if the advanced (b array) is too difficult, use

     the more basic approach - also in same thread full code.


As for descriptions of the commands

 - debate this after Nextion Instruction Set has been read.


The Nextion Instruction Set

  - is simplified to text in and bytes out

  - the format of is described here in Nextion Instruction Set

see also

    the Nextion TTL Serial thread.


This is so that it works with any MCU capable of TTL Serial

  - almost every command Nextion side can be used serial

    with the exception of blocks (if, else, while, for) and

    excepting bulk data (rept, wept, addt)


10,000+ MCUs, in over 100 programming languages

But user side MCU knowledge is prerequisite

  for this, it is the user that chose

    - the MCU that they intend to use

    - the programming language that they will use

    - the compiler that they intend to use


Nextion is not limited to one Arduino in Arduino C++

    but any MCU with Hardware Serial or by bitbanging two pins

But indeed the user needs to know their MCU side

    and how to send bytes over their hard/soft serial


So in short

   Help menuitem of the Help menu in Nextion Editor

   - all most important knowledge starts here (and sub links) 

Thank you

 

btw., which programming language and compiler do you use on PIC side ... ?

How to notify the MCU of Press/Release of a Button

image

This is indeed covered in the Tutorials

In Debug mode in the Return Data

   will send corresponding eight byte 0x65 touch return codes

   - described in Nextion Instruction Set Section 6


How to turn a button off from MCU side ...

   define logic of turning off a button ...

   If button component - this is a momentary component

      how was it ever left in an on state to be determined

      - but triggering the corresponding release with click command

        click b0,0ÿÿÿ

  If not a button component but a dual-state button component

      on or off state is determined by its .val attribute

      therefore sending the reverse of setting on is required

         bt0.val=0ÿÿÿ

  If not a button or dual-state button component

      the reverse of setting on is required

         examination of logic on to create logic off

      such as picture components

         p0.pic=3ÿÿÿ being on and p0.pic=4ÿÿÿ being off


The Nextion Instruction Set

   as brief as it is

     Represents the set of commands accepted by Nextion

Assigning component attributes MAYBE less obvious

     but still logical (used in examples and almost all threads)

   when local scope  component.attribute=valueÿÿÿ

   when global scope pagename.component.attribute=valueÿÿÿ


There isn't a complex data sheet but only simple wiki of commands as

   the Nextion is indeed not complex.

   - lack of float - Nextion is integer based  6000/2001=2 (corrected)

   - lack of order of operations - full assignment on operator

   - lack of complex evaluation - nest in simple evaluations

   Nextion is simple, but impressive when used for HMI


A more advanced topic is the page index/component array

   - study the keyboard code as base example

   .key attribute of Text Component/Number Component.




MikroC from Mikroelektronika
Here is the link:
https://www.mikroe.com/mikroc/#pic
or
https://www.mikroe.com/mikroc/#pic32
if i use a 32 controller.
Programing the controller it is not an issue for me.
My issue is to read in an interrupt the value of a two state push button when is pressed, and to send a command to reset the same push button OFF.
Until i get familiar with the ITEAD RTC, i will continue to use the micro RTC which is simpler for me.
As i do not display seconds, probably i will find a way to send to the screen the values of micro clock.
I have to read and learn how to send variable to screen.
How the screen read them and interpret.
How to send out on serial, variable from screen.
For the moment i use a custom made LCD , with the segments driven by a PIC18F87K90 chip, capable to drive LCD segments.

 

old3.png
(64.5 KB)
old2.png
(112 KB)
old1.png
(117 KB)
Thank you Patrick.
You made my day.

 

Patrick,
I took just a simple two state push button.
Attached are the screens.
For press or release it display the same code.
Where to read about 65Hex,
Byte two i believe is the page.
What is byte 3 and 4.
One is probably the push button with ID=1
But the other probably must be 1 or 0 to show the state, but on the captured commands it is always 1.
What i am missing here ?
There is a place to read the structure of the phrase
$65 $02 $01 $01 $ff $ff $ff  ?
On the help it is described just "click" but is also mentioned do not use for push or touch




 

release.png
(5.58 KB)
press.png
(4.81 KB)

Huge discussions/debates on RTC

 - where is source of official time?


If Nextion is official source, as in stand-alone

   (can be, as in user referring wrist to set)

Then official source is only bubble of space surrounding Nextion


If official source is not Nextion,

  then Nextion RTC is only a slave

To do as it is told to do - chosen how my programmer of MCU


This debate on RTCs and source of real time is decades old.

 - you will have fanatics on all sides of the debate

What source, how to transport, how to adjust, how to ...

Why create a time bubble around device

Why time displayed should be thought of as accurate at all

Drifts in crystal oscillation, why yours isn't good enough

Why your replacement choice isn't good enough

Why algorithms for correction is flawed and not good enough

When did Aliens bring time to mankind ....

Who gave time to them ...

Why quantum made all of it moot ...


Serial update already slow, inaccuracy because of delay over serial

Button press reaction time, did operator have triple expresso or decaf.


The term interrupt used in to capture button press"

  - is suggestive of an external button connected to MCU

    as Nextion does not have any interrupts.


But there will also be 100 paths to get to Rome on this one.

I meant receive interrupt on my MCU side to capture data Nextion send.
Thanks for remind me the landing place for my summer vacation.
I land to Rome, rent a car and drive south, Naples.

 

I found my answer

image



 

I think you now have a better understanding of

 - what Nextion is about

 - where all the commands are located (such as they are)

 - where to find examples, tutorials


Fast speedy development - check send component id


What remains is a blank programmable canvas

 - the more time spent by the artist, the better it becomes

 - the programming of Nextion internal logic - a user choice

   and here, so much becomes possible.


MCU should always remain in control of HMI.

 - so happy coding  =)


Datasheets are great in general, but you nevertheless also must read and understand them ...

    - a simple PIC 12F683 datasheet contains 176 pages,
    - a simple STM32F103C8T6TR comes with 100 pages,
    - a simple GD32F103RBT6 counts 50 pages ...

But even it is great to have such for such devices, this won't be the way to go for a Nextion-HMI solution.

Simply, a Nextion-HMI is not a simple LCD panel device. It is an assembly of many different parts, hardware and software, and that alltogether makes it a Nextion HMI-display.

On the backside, there is just a STM32F103 or a GD32F103 working. Datasheets are available from the anufacturers.
It makes no sense for Itead, to publish a copy of them ...

Even reading this datasheets won't help you a lot, because this chips are not plain, and you can't access them in a native way.

They are preprogrammed, with a bootloader, with an Interpreter-Engine, finally with your TFT ... this combination makes the magic of a Nextion-HMI ...

Therefore you only can access things, which are offered by the preprogrammed HMI-Interpreter-Engine.

And that's only a very small subset of what you can do according to its official mcu datasheet.

But the strategy of Nextion HMI-displays is not only to offer a simple and easy HMI solution, the goal is also to use a very powerfull mcu without the need to really deal with it natively. Therefore also no need to read and use the mcu's datasheet.

And with around 45 well thought basic text-oriented speaking commands you can access the whole power of a graphical display. Can it be more easy?

But you must once read and understand this commands.

They are well documented, even with small examples how to use ...

https://www.itead.cc/wiki/Nextion_Instruction_Set

Things like the RTC, there are even no commands to use. Itead tried to make it most easy. Simply 7 global variables which you can read and set from anywhere in your HMI code or from external mcu source.

As long as you know the command and it's parameters, as long as you know how to send such a command via simple serial connection, you are done.

How to send serially is not a real Nextion issue, that belongs more to the possibilities of your choosed mcu programming language and its compilers.

MikroC, MikroPascal and MikroBasic offers a complete commandset for this ... hardware serial, but also software serial ...

Most commands, as Patrick already stated, can be used within your HMI or just send out serial.
The only small difference between this 2 ways is, sending via serial, commands must be trailed with  chr(255,255,255)
 

as last, please keep a thread clean. One problem, one thread in the correct forum. This makes it much more easy for everybody out, to find and read the information he/she looks for ... nobody will go thru a 5 pages thread to find finally an important thread-headline-unrelated tip.


That's it ... just have fun ...

BMP
(313 KB)
Login or Signup to post a comment