В данной статье мы увидим как подключить модуль HC-11 к ATmega16/ATmega32 и приведем пример программы на языка C в Atmel Studio 6. Стоимость HC-11 в районе 3~4$ на Aliexpress, что совсем не дорого.
Рабочее напряжение модуля от 3.3В до 5.5В, но лучше подключить к 3.3В если необходимо интенсивно его использовать.
Подключается он просто, Vcc, GND…, вот только RXD и TXD нужно соединить наоборот: RXD модуля к TXD контроллера и TXD модуля к RXD контроллера. Так же подключаем второй к ПК.
Схема подключения радиомодуля HC-11 к ATmega16 /Atmega32

По умолчанию скорость HC-11 (HC-12) равна 9600. Если нужна другая скорость, подключаем SET к земле и меняем скорость. Как это сделать, смотрим на странице UART Радиомодуль HC-11 433МГц — передатчик/приемник.
Прошивку для ATmega16/ATmega32 написал на C в Atmel Studio 6. Для программирования контроллера использовал программатор STK500, а программу — AVR Studio 4. Ниже привёл пример прошивки.
Пример программы в Atmel Studio 6 для ATmega16/ATmega32
// ATmega16 - ATmega32 Example #define F_CPU 11059200UL #include <avr/io.h> #include <util/delay.h> #include <avr/interrupt.h> #define BAUD_RATE 9600 #define UBRR F_CPU/16/BAUD_RATE-1 char message[125] = "Hello! I am ATmega16!"; int n = 125; int i = 0; ISR(USART_UDRE_vect) { if(i == n) { UDR = 13; i++; } else if(i == n + 1) { UDR = 10; _delay_ms(1000); i = 0; } else { UDR = message[i++]; } } int main(void) { n = strlen(message); /* USART init */ /* Set baud rate */ UBRRH = (char)(UBRR>>8); UBRRL = (char)(UBRR); UCSRA = 0; /* Enable receiver and transmitter RXCIE: RX Complete Interrupt [Disable] TXCIE: TX Complete Interrupt [Disable] UDRIE: USART Data Register Empty Interrupt [Enable] */ UCSRB = (1<<RXEN) | (1<<TXEN) | (0<<RXCIE) | (0<<TXCIE) | (1<<UDRIE); /* Set frame format: 8data, 2stop bit URSEL: USART Mode Select [Synchronous Operation] USBS: Stop Bit Select [2-bit] UCSZ1,UCSZ0: Character Size [8-bit] */ UCSRC = (1<<URSEL) | (1<<USBS) | (1<<UCSZ1) | (1<<UCSZ0); sei(); while(1) { } }
После прошивки подключил модули, один к AVR другой к компьютеру, запустил Terminal v1.9b и вуаля, всё работает, микроконтроллер ATmega16/ATmega32 передаёт нам большой привет.
Результат
Если всё правильно сделать, то вы должны получить такой результат, какой мы видим на картинке.
https://over-the-counter-drug.com/# п»їover the counter anxiety medication
https://amoxil.science/# amoxicillin 500 mg online
https://zithromax.science/# zithromax pill
Get here. Some trends of drugs.
https://stromectolst.com/# ivermectin 200mg
Top 100 Searched Drugs. Prescription Drug Information, Interactions & Side.
Comprehensive side effect and adverse reaction information. Everything what you want to know about pills.
ivermectin brand name
Read information now. Definitive journal of drugs and therapeutics.
Medscape Drugs & Diseases. Prescription Drug Information, Interactions & Side.
stromectol 15 mg
п»їMedicament prescribing information. All trends of medicament.
Actual trends of drug. Some are medicines that help people when doctors prescribe.
https://stromectolst.com/# ivermectin 4000 mcg
Definitive journal of drugs and therapeutics. Top 100 Searched Drugs.
earch our drug database. Get warning information here.
ivermectin syrup
Generic Name. earch our drug database.
Long-Term Effects. safe and effective drugs are available.
ivermectin 6mg
Definitive journal of drugs and therapeutics. Definitive journal of drugs and therapeutics.
Read now. Read here.
https://stromectolst.com/# where to buy stromectol online
Get here. Prescription Drug Information, Interactions & Side.
drug information and news for professionals and consumers. Actual trends of drug.
ivermectin nz
drug information and news for professionals and consumers. earch our drug database.
Best and news about drug. Medscape Drugs & Diseases.
buy ivermectin for humans uk
Top 100 Searched Drugs. Get here.
Some are medicines that help people when doctors prescribe. Top 100 Searched Drugs.
cost of levaquin for sale
Comprehensive side effect and adverse reaction information. Read now.
Drug information. Medscape Drugs & Diseases.
https://lisinopril.science/# lisinopril 18 mg
Medscape Drugs & Diseases. Top 100 Searched Drugs.
Everything information about medication. Drug information.
where can i buy generic nexium without prescription
Long-Term Effects. Some are medicines that help people when doctors prescribe.
Read here. safe and effective drugs are available.
https://lisinopril.science/# lisinopril brand name canada
Top 100 Searched Drugs. Read information now.