В данной статье мы увидим как подключить модуль 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 передаёт нам большой привет.
Результат
Если всё правильно сделать, то вы должны получить такой результат, какой мы видим на картинке.
п»їbest mexican online pharmacies: mexican pharmacy — buying prescription drugs in mexico online
http://canadaph24.pro/# canadian drug stores
canadian medications canadian pharmacies the canadian pharmacy
mexican border pharmacies shipping to usa: mexican pharmacy — buying from online mexican pharmacy
canadian pharmacy world Large Selection of Medications from Canada online canadian drugstore
http://indiaph24.store/# pharmacy website india
cost of propecia price cost of propecia without prescription propecia otc
tamoxifen 20 mg: pct nolvadex — tamoxifen lawsuit
http://ciprofloxacin.tech/# buy ciprofloxacin
buying cheap propecia without a prescription: buying generic propecia — propecia order
order cytotec online cytotec pills buy online buy cytotec in usa
https://finasteride.store/# cost generic propecia no prescription
cytotec online: buy cytotec over the counter — buy cytotec
lisinopril 20 mg price in india: price of lisinopril generic — lisinopril 2 5 mg tablets
buy cipro online canada cipro 500mg best prices ciprofloxacin over the counter
http://finasteride.store/# order cheap propecia without a prescription
cipro pharmacy: where can i buy cipro online — ciprofloxacin 500 mg tablet price
https://lisinopril.network/# lisinopril 20 tablet
cheap lisinopril no prescription medication lisinopril 10 mg prinivil 10 mg
cipro online no prescription in the usa: buy ciprofloxacin — buy cipro cheap
https://cytotec.club/# cytotec buy online usa
cost cheap propecia for sale generic propecia without prescription buy propecia without dr prescription
lisinopril 60 mg: zestril price — lisinopril 12.5 tablet
https://finasteride.store/# cost of generic propecia online
tamoxifen therapy hysterectomy after breast cancer tamoxifen tamoxifen skin changes
tamoxifen buy: nolvadex during cycle — tamoxifen and depression
zestoretic tabs zestril 10 mg price lisinopril tabs 4mg
http://lisinopril.network/# price of zestril
order propecia without insurance: propecia order — cost of propecia tablets
get propecia tablets generic propecia without prescription cost propecia without dr prescription
http://finasteride.store/# buying propecia without insurance
purchase cipro buy ciprofloxacin over the counter ciprofloxacin generic price
tamoxifen warning: where can i buy nolvadex — tamoxifen joint pain
http://lisinopril.network/# url lisinopril hctz prescription
purchase cipro buy cipro online where can i buy cipro online
low dose tamoxifen: nolvadex price — tamoxifen endometriosis
Levitra tablet price Cheap Levitra online Levitra 20 mg for sale
viagra canada: Cheapest place to buy Viagra — Viagra generic over the counter
http://kamagra.win/# cheap kamagra
Kamagra 100mg buy kamagra online buy kamagra online usa
Viagra without a doctor prescription Canada: Buy Viagra online cheap — Cheap Viagra 100mg
https://levitrav.store/# Levitra 10 mg best price
Cheap Viagra 100mg Buy generic 100mg Viagra online Sildenafil 100mg price
sildenafil 50 mg price: Cheapest place to buy Viagra — sildenafil online
Cheap Sildenafil 100mg Cheapest Sildenafil online sildenafil online
https://cialist.pro/# cheapest cialis
Buy generic Levitra online: Vardenafil online prescription — Buy Vardenafil 20mg online
п»їkamagra kamagra п»їkamagra
http://kamagra.win/# Kamagra tablets
Generic Cialis price: buy cialis overseas — Generic Cialis price
Purchase Cenforce Online: buy cenforce — cheapest cenforce
Cenforce 150 mg online cheapest cenforce Buy Cenforce 100mg Online
buy canadian drugs trustworthy canadian pharmacy canadianpharmacyworld
buy medicines online in india: buy medicines online in india — top 10 online pharmacy in india
http://pharmmexico.online/# mexico drug stores pharmacies
buy drugs without prescription canada pharmacy without prescription best online prescription
buying prescription drugs from canada: canada pharmacy coupon — pharmacy coupons
mail order pharmacy india online shopping pharmacy india pharmacy website india
no prescription medicine: mexico prescription drugs online — buy drugs without prescription
http://pharmnoprescription.icu/# canada prescription
medications online without prescriptions: buy medications online no prescription — no prescription medication
pharmacy website india pharmacy website india top online pharmacy india
http://pharmcanada.shop/# canada rx pharmacy world
mexican rx online: purple pharmacy mexico price list — medicine in mexico pharmacies
https://pharmworld.store/# no prescription needed canadian pharmacy
best india pharmacy: legitimate online pharmacies india — indian pharmacy
buy zithromax online australia average cost of generic zithromax zithromax 500 mg for sale
https://gabapentinneurontin.pro/# buy neurontin canada
where can i order prednisone 20mg: prednisone 20mg online — prednisone 5093