MCU sends and receives program C program

Updated on technology 2024-05-29
12 answers
  1. Anonymous users2024-02-11

    Simulate SPI or IIS bus or serial port or define a certain communication mode by yourself.

  2. Anonymous users2024-02-10

    It's not enough to simulate serial communication by yourself.

  3. Anonymous users2024-02-09

    Add me, I've written it, come and get it.

  4. Anonymous users2024-02-08

    It's so messy, I'm here to help you write it!

  5. Anonymous users2024-02-07

    MCU Something I seem to have heard.

  6. Anonymous users2024-02-06

    It's good that I wrapped the hardware spi program myself, and I will share it with Include

    For other models, change the corresponding SPI port.

    void init_spi(void)

    void spi_write(uchar temp)uchar spi_read(void)

  7. Anonymous users2024-02-05

    Judging from the problem you have, you should have sent 0, 1, 2, 3 ......255 numbers, not their corresponding ASCII values. For example, if you want to send an ASCII value of 0 in the serial debugging tool, you should send an ASCII value of 0; Suppose your serial port sends a one-byte function: sendbyte(unsigned char n);

    Then the sending function can be written like this:

    void send(void)

    Remove the hexadecimal display and you can see the 0-255 display.

  8. Anonymous users2024-02-04

    You can find a better serial assistant.,Find one that supports decimal system.。 In fact, the hexadecimal system is not a big deal, isn't ff just 255?

  9. Anonymous users2024-02-03

    unsigned int a;

    a=100;

    printf(“%d”,a);The output data is displayed in text format on the upper computer in 10 base.

  10. Anonymous users2024-02-02

    Whether you don't know how to write a program for a microcontroller or a computer program.

  11. Anonymous users2024-02-01

    How exactly is the random delay set:

    Random delay setting, you can use the TL0 of timer0 as a random parameter, after the communication is sent, the PC side is best to return a response, the single-chip microcomputer receives the response, it knows that the PC receives the data, can not receive, immediately take TL0 as the random delay count value, and then send the data after the delay.

  12. Anonymous users2024-01-31

    Each microcontroller sets a unique address, and the host takes turns to ask who is who. The time of taking turns to ask can be fixed, and the same time is used for each single-chip microcomputer, and the timeout is transferred to the next time. For construction, please refer to the 485 communication mode.

Related questions
4 answers2024-05-29

You use a P1 port to control the dynamic scanning of 8 digital tubes, and the dynamic scanning display of digital tubes needs to be blanked. >>>More

9 answers2024-05-29

Initialize three interrupts, x0 x1 t2.

T2 is started by x0 to send serial data at regular intervals and in cycles; >>>More

5 answers2024-05-29

I don't know what kind of model the LCD you are using, it doesn't seem like 1602. >>>More

5 answers2024-05-29

Hello: I wrote the program:

#include >>>More

18 answers2024-05-29

Landlord, org 0030h.

How do you understand what I mean? >>>More