Summary of HAC-UM wireless data transmission module

Source: Internet
Author: User

In the process of debugging the HAC-UM96, encountered a lot of problems, and may not use 51 for a long time, write the program has no idea, but later I found the write feeling. My biggest difficulty lies in the hardware. I have never felt about the hardware. As a result, once a problem has occurred, I often have no idea. During the debugging process over the past few days, I gradually summed up what I was blocked. A few points: 1. Poor welding skills, welding a simple circuit takes a long time to practice. 2. Lack of devices. From now on, you can accumulate some circuits and tools. 3. You can contact the company and product customer service, some of their methods may not help you solve the problem, but it can give me inspiration to test the simplest method of HAC-UM96 :( 1) write the serial port transmitter program, pay attention to the baud rate of 9600, 1-bit stop bit, and no check bit (select Serial Communication Mode 1 in 51 ). The source code I wrote is as follows: [cpp]/* Open the serial port debugging program, set the baud rate to 11.0592, 1-bit stop bit, no parity crystal oscillator MHz. * // # include <reg52.H> # define uchar unsigned char # define uint unsigned int void delayms (uint xms); uchar flag; // generate interrupt mark // initialize void uart_init () {www.2cto.com TMOD | = 0x20;/* TMOD: timer 1, mode 2, 8-bit reload */TH1 = 0xfd;/* TH1: reload value for 9600 baud @ 11.0592 MHz */TL1 = 0xfd; TR1 = 1;/* TR1: timer 1 run */REN = 1; // allow Serial Port receiving SM0 = 0; // select the serial port communication mode 1 SM1 = 1; EA = 1;/* total opening interruption */ES = 1; /* Open the serial port to interrupt */}/* main Program */void main (void) {uart_init (); // serial port initialization SBUF = 0x55; while (1) {if (flag = 1) {delayms (500); // latency 0.5 s SBUF = 0x55 ;}} void delayms (uint xms) {uint I, j; for (I = xms; I> 0; I --) for (j = 110; j> 0; j --);} void UART_SER (void) interrupt 4 // The serial interrupt service program {if (RI) // determines if the receipt interrupt is generated {RI = 0; // The flag is cleared} if (TI) // if it is a sending flag, it is cleared {TI = 0; flag = 1 ;}} (2) Add all five short caps in the HAC-UM; (3) Add a HAC-UM96 (TA) GND, VCC, TXD, RXD directly connected to the mcu gnd, VCC, RXD, TXD, pay attention to RXD to TXD; (4) will be another HAC-UM96 (TB) GND and VCC are also connected to the single-chip microcomputer board. Observe the TXD of TB with the oscilloscope and see the following waveform: (5) communication is completed. Note: you can test the current to check whether the sending end can send data. However, the transmitting end must send data in the same way. It is best not to have a delay. Otherwise, the measured current is 0, I have measured the maximum current of 250mA in the case of continuous transmission.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.