kit Posted June 12, 2007 Share Posted June 12, 2007 am codul:__CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUTmain call 0x3FF ; retrieve factory calibration value bsf STATUS,RP0 ; set file register bank to 1 movwf OSCCAL ; update register with factory cal value bcf STATUS,RP0 ; set file register bank to 0; remaining code goes here banksel TRISIO movlw 0x02 movwf TRISIO movlw 0x00 movwf WPU bsf OPTION_REG,NOT_GPPU banksel GPIOloop: btfss GPIO,GP1 bsf GPIO,GP0 call delayx bcf GPIO,GP0 call delayx goto loop delayx: movlw 0xa0 ;0x07 movwf tempxdelayx_loop: decfsz tempx,F goto delayx_loop return... care ar trebui sa-mi flicaie pe GP0 un led atunci cand pe GP1 am 0, iar cand am 1 sa-l lase stins. In simulator o face, dar in realitate ba... Nu ma taie nici in ruptul capului de ce naiba, ma poate ajuta cineva? Link to comment
sofian Posted June 12, 2007 Share Posted June 12, 2007 delayx este o intirziere de max 1mS, deci nu ai cum sa vezi ca "flicaie" ledul. Link to comment
kit Posted June 12, 2007 Author Share Posted June 12, 2007 am uitat sa specific: semnalul de pe GP0 il vizualizez pe osciloscop. datele prezentate in problema sunt certe. le-am trait pe pielea mea. imi scapa ceva, dar nu vad ce: am citit documentatia si pe muchie, dar nu vad unde-i scaparea. Link to comment
kit Posted June 13, 2007 Author Share Posted June 13, 2007 uf! am gasit! lipsea:MOVLW 0X07MOVWF CMCONscria treaba asta si intr-o nota, dar... Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now