rahmat700 0 Report post Posted April 14, 2012 kawan2 ,, aku nak blaja untuk program pic,, tp aku xtau nak bezakan c, c++ atau assambly language,, korg blh terangkan x ,,pls konfius ni Quote Share this post Link to post Share on other sites
NeoLogy 74 Report post Posted April 14, 2012 C/C++ ni high level language Assembly low level language.. high level ni maknanya, code dia tu bile kita baca..kita bleh paham dengan mudah sebab dia mostly 'english like' language.. low level ni bahasa code dia tu sukar nak paham sebab dia bukan macam 'english like'. contoh c/c++ [code] #include <pic16f87.h> __CONFIG(0x3733); TRISA = 0xFF; TRISB = 0x00; void main(void) { while(1){ if(RA1==0){ RB2=1; }else{ RB2=0; } } } [/code] kalau baca code di atas, ko bleh paham kan dengan mudah ape operation dia?cuba ko baca yang bawah ni lak..senang tak nak paham [code] #include p16F877.inc __config _HS_OSC & _WDT_OFF & _LVP_OFF & _PWRTE_ON ORG 0 RESET nop goto START ORG 4 START bsf STATUS,RP0 movlw b'11111111' movwf TRISA movlw b'00000000' movwf TRISB bcf STATUS,RP0 MAIN movf PORTA,W movwf PORTB goto MAIN end [/code] Quote Share this post Link to post Share on other sites
rahmat700 0 Report post Posted April 16, 2012 aku beginnner lg,, ape perkara wajib sblom tulis aturcara...... #include <pic16f87.h> __CONFIG(0x3733); Quote Share this post Link to post Share on other sites
NeoLogy 74 Report post Posted April 17, 2012 include file tu adalah setting untuk microcontroller/microprocessor yang ko guna..macam bit assignment, port assignment address..timer setting, prescaller, dan macam2 setting lagi.. ini untuk memudahkan programmer utk buat coding tanpa perlu merujuk kepada datasheet microcontroller dengan terperinci.. __CONFIG(0x3732) ni biasanya configuration utk uController yang ko gune..macam nak enablekan watchdog timer ke..dan lain2 lagi..sila refer dengan datasheet utk maklumat lanjut.. dalam C, benda wajib.. include header file (jika ada) mesti ada function main() <- ni adalah entry point program ko lain-lain configuration tu optional..kalau ko tak set ape2..maknanya dia akan guna default settings... selalunya aku akan set ikut spec program dan hardware yang aku nak.. Quote Share this post Link to post Share on other sites
rahmat700 0 Report post Posted April 18, 2012 wah,, ko bleh jadi guru aku x,, aku takde org yg blh ajo aku ar,,, data sheet tu kite kene rujuk pd datasheet pic yg kite gune la,, contoh pic16f84a Quote Share this post Link to post Share on other sites
NeoLogy 74 Report post Posted April 18, 2012 aku xdela pandai sangat pic ni..lama jgak la aku tinggal pic ni..pic16f84 ni time diploma dulu ada la buat fyp..time degree blaja pic16f877a..time practical blaja pic18f845a..tapi basic dia sama je..bagus la kalo ko start dengan pic16f84a..dia tak complicated sangat dan tak banyak sangat i/o port..nak bantu sket2 tu bleh la.. Quote Share this post Link to post Share on other sites
rahmat700 0 Report post Posted April 19, 2012 ape sofware yg sesuai tuk aku buat aturcara,,, kalau aku guna pic basic pro punye software ok x?? Quote Share this post Link to post Share on other sites
NeoLogy 74 Report post Posted April 19, 2012 PIC Basic Pro gune language BASIC..dan ko kena beli program tu..better ko gune MPLab yang dikeluarkan oleh Microchip..boleh download secara percuma dari website diorang..MPLab ni IDE yang ada editor dan compiler.. language dia C, nak inline assembly pun boleh... aku cadang ko gi kat cytron.com.my..diorang banyak buat starter kit untuk new programmer..pastu dia ada contoh2 program..ada technical assistant gak..ade demo.. Quote Share this post Link to post Share on other sites
rahmat700 0 Report post Posted April 19, 2012 aku da bli dah pcb starter untuk pic 16f84a tp xreti mula... Quote Share this post Link to post Share on other sites
otai_g 3 Report post Posted May 9, 2012 bila taip code c/c++ utk pic, then ms nak build or masukkan program dlm pic tu, compiler akan convert balik coding c/c++ tu kpd assembler language. pk2 balik elok direct wat coding pakai assembly language terus jah lg best. Quote Share this post Link to post Share on other sites
rahmat700 0 Report post Posted May 9, 2012 haa pening2... bleh bagi laman web yg boleh tunjuk cara2 wat programming basic x Quote Share this post Link to post Share on other sites
minumkopi87 0 Report post Posted June 28, 2012 info bergune dari forumer.. thanks Quote Share this post Link to post Share on other sites