تبلیغات
برق فشار قوی - حل تمرین میکرو
 
برق فشار قوی
علم+اخلاق=انسانیت/علم-اخلاق=؟
                                                        
درباره وبلاگ


مدیر وبلاگ : نیما ایرانی
نویسندگان
آمار وبلاگ
  • کل بازدید :
  • بازدید امروز :
  • بازدید دیروز :
  • بازدید این ماه :
  • بازدید ماه قبل :
  • تعداد نویسندگان :
  • تعداد کل پست ها :
  • آخرین بازدید :
  • آخرین بروز رسانی :
یکشنبه 14 اردیبهشت 1393 :: نویسنده : نیما ایرانی
برنامه نمایش keypad بروی lcd با وقفه

لطفا به نکات زیر توجه کنید
به جای تمامELSE ها از else استفاده کنید
به تعریف شدن lcd در ابتدای برنامه توجه کنید
lcd به پورت c متصل شده است
به تابع وقفه توجه کنید با رنگ ابی مشخص شده است
به فعال سازی وقفه همگانی توجه کنید با رنگ سبز مشخص شده است
کد برنامه در ادامه مطالب قرار دارد
باید توجه کنید به دلیل ناسازگاری فونت حتما برای دیدن حالت درست کد ها انها را در برنامه کد ویژن کپی کنید
#include <mega16.h>
#asm
   .equ __lcd_port=0x15
#endasm
#include <lcd.h>
interrupt [EXT_INT0] void ext_int0_isr(void)
{
PORTA=0XFE
if(PINA=0XEE){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(7)
}
ELSE if(PINA=0XDE){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(8)
}
ELSE if(PINA=0XBE){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(9)
}
ELSE if(PINA=0X7E){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR('/')
PORTA=0XFD
}
PORTA=0XFD
 if(PINA=0XED){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(4)
}
ELSE if(PINA=0XDD){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(5)
}
ELSE if(PINA=0XBD){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(6)
}
ELSE if(PINA=0X7D){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR('*')
}
PORTA=0XFB
if(PINA=0XEB){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(1)
}
ELSE if(PINA=0XDB){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(2)
}
ELSE if(PINA=0XBB){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(3)
}
ELSE if(PINA=0X7B){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR('-')
}
PORTA=0XF7
if(PINA=0XE7){
LCD_CLEAR
}
ELSE if(PINA=0XD7){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR(0)
}
ELSE if(PINA=0XB7){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR('=')
}
ELSE if(PINA=0X77){
LCD_CLEAR
LCD_GOTOXY(0,0)
LCD_PUTCHAR('+')
}

}
}
void main(void)
{
PORTA=0x00;
DDRA=0x0F;
PORTB=0x00;
DDRB=0x00;
PORTC=0x00;
DDRC=0x00;
PORTD=0x00;
DDRD=0x00;

GICR|=0x40;
MCUCR=0x02;
MCUCSR=0x00;
GIFR=0x40


lcd_init(16);

// Global enable interrupts
#asm("sei")

while (1)
      {
      // Place your code here

      };
}
حل تمرین مربوط به ازمایشگاه keypad+ای سی



/*****************************************************
This program was produced by the
CodeWizardAVR V2.05.0 Evaluation
Automatic Program Generator
© Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com

Project :
Version :
Date    : 03/02/2021
Author  : Freeware, for evaluation and non-commercial use only
Company :
Comments:


Chip type               : ATmega16
Program type            : Application
AVR Core Clock frequency: 8.000000 MHz
Memory model            : Small
External RAM size       : 0
Data Stack size         : 256
*****************************************************/

#include <mega16.h>
#include <delay.h>

// External Interrupt 0 service routine
interrupt [EXT_INT0] void ext_int0_isr(void)
{
if(PINA==0XF1){
PORTC=0X04;}
else if(PINA==0XF2){
PORTC=0X07;
}
else if(PINA==0XF3){
PORTC=0X03;
}
else if(PINA==0XF4){
PORTC=0X02;
}
else if(PINA==0XF5){
PORTC=0X05;
}
else if(PINA==0XF6){
PORTC=0X08;
}
else if(PINA==0XF7){
PORTC=0X00;
}
else if(PINA==0XF8){
PORTC=0X03;
}
else if(PINA==0XF9){
PORTC=0X06;
}
else if(PINA==0XF0){
PORTC=0X01;
}
else if(PINA==0XFA){
PORTC=0X09;
}
// Place your code here

}

// Declare your global variables here

void main(void)
{
// Declare your local variables here

// Input/Output Ports initialization
// Port A initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=P State6=P State5=P State4=P State3=P State2=P State1=P State0=P
PORTA=0xFF;
DDRA=0x00;

// Port B initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTB=0x00;
DDRB=0x00;

// Port C initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTC=0x00;
DDRC=0xFF;

// Port D initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTD=0x00;
DDRD=0x00;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=0xFF
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer1 Stopped
// Mode: Normal top=0xFFFF
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer2 Stopped
// Mode: Normal top=0xFF
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization
// INT0: On
// INT0 Mode: Rising Edge
// INT1: Off
// INT2: Off
GICR|=0x40;
MCUCR=0x03;
MCUCSR=0x00;
GIFR=0x40;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;

// USART initialization
// USART disabled
UCSRB=0x00;

// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// ADC initialization
// ADC disabled
ADCSRA=0x00;

// SPI initialization
// SPI disabled
SPCR=0x00;

// TWI initialization
// TWI disabled
TWCR=0x00;

// Global enable interrupts
#asm("sei")

while (1)
      {
      // Place your code here

      }
}





نوع مطلب :
برچسب ها :
لینک های مرتبط :




جمعه 16 آذر 1397 11:03 ق.ظ

Amazing all kinds of helpful knowledge.
cialis for sale in europa interactions for cialis estudios de cialis genricos cialis price thailand click here cialis daily uk cialis canada warnings for cialis cilas buy name brand cialis on line cialis canadian drugs
سه شنبه 13 آذر 1397 06:42 ب.ظ

You said that wonderfully!
cialis prezzo in linea basso free cialis cialis coupons cialis for sale in europa tadalafil 5mg cialis therapie cialis diario compra wow cialis 20 cialis name brand cheap cialis super acti
سه شنبه 13 آذر 1397 07:35 ق.ظ

Kudos, I enjoy it.
cialis 10mg prix pharmaci when can i take another cialis cialis price in bangalore cialis pills boards no prescription cialis cheap cipla cialis online cialis generic tadalafil buy prices on cialis 10 mg enter site very cheap cialis tadalafil 10 mg
دوشنبه 12 آذر 1397 07:14 ق.ظ

You said it nicely..
precios de cialis generico deutschland cialis online cialis 20 mg enter site natural cialis cialis diario compra opinioni cialis generico import cialis cialis kaufen wo viagra cialis levitra 5 mg cialis coupon printable
یکشنبه 11 آذر 1397 07:10 ب.ظ

Amazing plenty of superb tips.
cialis uk recommended site cialis kanada achat cialis en europe weblink price cialis tadalafil 20 mg buy cheap cialis in uk cialis prices if a woman takes a mans cialis precios cialis peru viagra vs cialis vs levitra
شنبه 10 آذر 1397 07:28 ب.ظ

Whoa tons of valuable tips.
cialis lilly tadalafi generic cialis in vietnam viagra vs cialis vs levitra wow cialis tadalafil 100mg cialis for sale in europa cialis 10 doctissimo buy generic cialis cialis e hiv achat cialis en suisse buy cialis
شنبه 10 آذر 1397 06:21 ق.ظ

You actually expressed that terrifically.
cialis pills price each 40 mg cialis what if i take buy cialis cialis 200 dollar savings card comprar cialis 10 espa241a buy generic cialis non 5 mg cialis generici tarif cialis france brand cialis nl generic for cialis
جمعه 9 آذر 1397 07:04 ب.ظ

Whoa loads of fantastic knowledge.
cialis patent expiration generic cialis 20mg uk cialis price thailand cialis official site buy original cialis cialis bula when can i take another cialis pastillas cialis y alcoho cialis rckenschmerzen link for you cialis price
جمعه 9 آذر 1397 07:17 ق.ظ

Superb write ups. Thank you!
cialis mit grapefruitsaft female cialis no prescription best generic drugs cialis we choice free trial of cialis cialis for sale cialis generisches kanada cialis reviews cialis professional from usa cialis professional yohimbe fast cialis online
پنجشنبه 8 آذر 1397 08:05 ب.ظ

Thanks. Lots of stuff.

we use it cialis online store acheter cialis meilleur pri cialis pas cher paris cialis side effects cialis 20mg preis cf cialis free trial cialis pills callus cialis 200 dollar savings card cialis rezeptfrei sterreich
چهارشنبه 7 آذر 1397 07:32 ب.ظ

Really plenty of helpful info.
tadalafil tablets generic cialis review uk brand cialis nl buy name brand cialis on line cialis 30 day sample cialis 5 mg effetti collateral cialis 20 mg cut in half cialis flussig we recommend cheapest cialis cialis sale online
دوشنبه 9 مهر 1397 05:11 ق.ظ

You said it nicely.!
cialis price in bangalore dose size of cialis canadian discount cialis cialis 5 mg funziona canadian drugs generic cialis best generic drugs cialis cialis free trial achat cialis en suisse rezeptfrei cialis apotheke generic cialis tadalafil
یکشنبه 1 مهر 1397 06:57 ق.ظ

You revealed it really well.
canadian drug viagra canadiense canadian pharmacy viagra brand drugstore online shopping canadian pharmacies that are legit trust pharmacy canada reviews global pharmacy canada canadian drugstore canada drugs online canadianpharmacyusa24h
چهارشنبه 28 شهریور 1397 03:44 ق.ظ

Thanks! An abundance of forum posts!

import cialis online prescriptions cialis order generic cialis online cialis pills price each cialis price in bangalore cialis for bph how much does a cialis cost cialis kaufen wo viagra vs cialis cialis for sale south africa
پنجشنبه 15 شهریور 1397 07:29 ب.ظ

Kudos. A good amount of facts!

canadian drugs generic cialis cialis with 2 days delivery achat cialis en suisse generic cialis buy generic cialis tesco price cialis cialis kaufen buy generic cialis interactions for cialis where do you buy cialis
چهارشنبه 14 شهریور 1397 11:42 ق.ظ

Kudos! An abundance of forum posts.

buy vistagra online safe online canadian pharmacy canadian pharmacy cialis canadian pharmacies-24h northwest pharmacies in canada trust pharmacy canadian drugs for sale drugstore online are canadian online pharmacies safe drugstore online canada
سه شنبه 13 شهریور 1397 02:05 ب.ظ

Thanks. I value this!
where to buy viagra over the counter can i buy viagra over the counter purchase viagra uk can you buy viagra without prescriptions cheap online viagra uk buy now viagra buy viagra online cheap viagra super active viagra uk buy online best place to buy generic viagra
دوشنبه 12 شهریور 1397 11:31 ق.ظ

Really lots of good information.
cialis 20 mg cut in half we recommend cheapest cialis how to purchase cialis on line cialis generico lilly tadalafil tablets 5 mg cialis pharmacie en ligne cialis preise schweiz cialis en 24 hora cialis canada on line cialis generika in deutschland kaufen
سه شنبه 23 مرداد 1397 07:40 ق.ظ

Amazing tips. Thank you!
buy viagra super active online viagra online buy buy viagra online order viagra online without buy generic viagra no prescription online pharmacy for viagra order viagra online without a prescription buy viagra no rx buying viagra online uk viagra generic online pharmacy
دوشنبه 22 مرداد 1397 11:17 ب.ظ

Nicely put, Cheers.
cialis 50 mg soft tab where do you buy cialis brand cialis generic achat cialis en europe opinioni cialis generico acheter cialis kamagra cialis flussig buy cialis tesco price cialis canadian cialis
دوشنبه 7 خرداد 1397 11:52 ق.ظ

Beneficial facts. Thanks!
cialis uk next day cialis 30 day sample we recommend cheapest cialis canadian discount cialis cialis side effects buying cialis on internet cialis coupons printable cialis rckenschmerzen acheter cialis meilleur pri india cialis 100mg cost
چهارشنبه 5 اردیبهشت 1397 08:40 ق.ظ

You said it nicely..
where can i get viagra prescription buy generic viagra cheap where can i order viagra online sildenafil uk buy generic viagra pills how to buy viagra online without where to buy viagra for women how to buy real viagra online buy viagra online price how to buy viagra without a prescription
شنبه 18 فروردین 1397 05:54 ب.ظ

You expressed this perfectly!
cialis y deporte cialis coupons printable are there generic cialis cialis australian price when can i take another cialis cialis baratos compran uk cialis 50 mg soft tab cialis 5mg billiger tadalafil generic cialis for sale in europa
شنبه 4 فروردین 1397 10:52 ب.ظ

Many thanks, An abundance of write ups.

cialis great britain cialis taglich prezzo di cialis in bulgaria viagra or cialis get cheap cialis cuanto cuesta cialis yaho cialis pills in singapore viagra cialis levitra chinese cialis 50 mg low cost cialis 20mg
پنجشنبه 2 فروردین 1397 05:55 ب.ظ

You actually suggested this terrifically!
safe dosage for cialis estudios de cialis genricos tadalafil 10 mg cialis wir preise how much does a cialis cost look here cialis cheap canada tadalafilo cialis usa cost tadalafil 5mg cialis for bph
سه شنبه 22 فروردین 1396 01:48 ب.ظ
Hello, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam comments?
If so how do you protect against it, any plugin or anything
you can advise? I get so much lately it's driving me mad so any help is very much appreciated.
دوشنبه 21 فروردین 1396 12:50 ب.ظ
Your style is really unique compared to other folks I have
read stuff from. Thank you for posting when you've got the opportunity, Guess I will just book mark this site.
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر