We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Merhabalar, uart interrupt almasını okumak istiyorum. Benim kesintim çalışıyor. Örneğin 0x02 gönderiyorum. bu değeri görmek istiyorum. mesela 0x02 aldığımda led yakabiliyorum. şimdilik kesintiye uğradığımda ledim yanıyor. 8051 kullanıyorum. kodlarımı;
#include "N76E003.h" #include "SFR_Macro.h" #include "Common.h" #include "Gecikme.h" #include "Function_define.h"
işaretsiz karakter c; biraz riflag; void SerialPort0_ISR (void) interrupt 4 { if (RI == 1) { clr_RI; c = SBUF; riflag = 1; } }
void main (void) { P12_PushPull_Mode; P07_Quasi_Mode; InitialUART0_Timer1 (9600); set_ES; set_EA;
while (1) { if (riflag) { P12 = ~ P12; riflag = 0; } } }
In English:
https://community.arm.com/developer/tools-software/tools/f/keil-forum/48940/uart-interrupt-receive-read