This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Send serial commands over GPIO on nRF52832

Hello, I'm having a trouble over here, I read some tutorials for creating custom services and characteristics for BLE, and everything is running fine, I have a service with a characteristic that hold some text in hex (uint8_t), and I set the permissions to read/write that characteristic, now, i want to send a serial command over one of the GPIO ports, and I'm using the nRF52 DK so I'm using the P0.06 (TXD) and P0.08 (RXD), but I don't have a clue how to send the serial command to those GPIO ports, I need to send a command for a nextion TFT screen, to change a value, so I need to send a text first like (t0.val="test") and then 0xFF three times so the screen will read the commands.

How do I do that on the nRF52832?, I saw a UART example on the SDK but I cannot understand it very well, I don't want to establish a deep connection, just send some commands, and I might also point that I'm a beginner on C programming.

Parents
  • a nextion TFT screen

    One of these: https://nextion.itead.cc/ ?

    That page says:

    "NEXTION display quickly connects to MCU via 5V TTL Serial"

    Note that nRF52832 pins are not 5V tolerant.

    I need to send ... 0xFF three times so the screen will read the commands.

    Are you sure? The page also says:

    "utilizes simple ASCII text based instructions"

    0xFF would not normally be considered "ASCII text".

  • Hello, sorry for the late response, I'm really stuck over this, I already managed to get the uart example working over the USB cable I connect to the nRF52 DK, I can send and read the serial data, however, when trying to use my nextion screen nothing happens, you said that the MCU connect via 5V TTL serial, however over here https://www.itead.cc/wiki/NX4024T032 it says that the screen can recognize the 3.3V as a high, and I'm powering the screen with 5V from an external source, so what might be wrong?, do the TX from the screen transmit 5V and the nRF52832 gets errors?

    About the 0xFF, those are endlines, I'm sending the ASCII text instruction followed by 0xFF three times, that's how it worked over the Nextion Editor debugger (A debugger for the screen).

    I don't really know what can be wrong, I feel that the 5V TTL should not be a problem.

    PD: I'm using the pins 23 as RX and 25 as TX on the nRF52 DK

Reply
  • Hello, sorry for the late response, I'm really stuck over this, I already managed to get the uart example working over the USB cable I connect to the nRF52 DK, I can send and read the serial data, however, when trying to use my nextion screen nothing happens, you said that the MCU connect via 5V TTL serial, however over here https://www.itead.cc/wiki/NX4024T032 it says that the screen can recognize the 3.3V as a high, and I'm powering the screen with 5V from an external source, so what might be wrong?, do the TX from the screen transmit 5V and the nRF52832 gets errors?

    About the 0xFF, those are endlines, I'm sending the ASCII text instruction followed by 0xFF three times, that's how it worked over the Nextion Editor debugger (A debugger for the screen).

    I don't really know what can be wrong, I feel that the 5V TTL should not be a problem.

    PD: I'm using the pins 23 as RX and 25 as TX on the nRF52 DK

Children
No Data
Related