-
Simulate SPI or IIS bus or serial port or define a certain communication mode by yourself.
-
It's not enough to simulate serial communication by yourself.
-
Add me, I've written it, come and get it.
-
It's so messy, I'm here to help you write it!
-
MCU Something I seem to have heard.
-
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)
-
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.
-
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?
-
unsigned int a;
a=100;
printf(“%d”,a);The output data is displayed in text format on the upper computer in 10 base.
-
Whether you don't know how to write a program for a microcontroller or a computer program.
-
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.
-
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.
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
Initialize three interrupts, x0 x1 t2.
T2 is started by x0 to send serial data at regular intervals and in cycles; >>>More
I don't know what kind of model the LCD you are using, it doesn't seem like 1602. >>>More
Hello: I wrote the program:
#include >>>More
Landlord, org 0030h.
How do you understand what I mean? >>>More