J
janosandi
Guest
Kamusta guys ako ay alot problema proramming 12c508 ngunit ngayon ay gumagana nang maayos i isang maliit na problema ngayon couldnt i makahanap ng solusyon para dito (ang parehong Fuction gumagana on12f629) ang maaari kong gumawa ng GP0 & GP1 pupunta Mataas Ngunit kapag ginagawa ang parehong sa GP2 pa rin ito 0 Anumang mga ideya? dito ay isang piraso ng code na im gamit ang
Gamit ito sa GP0 mataas
Sa ito sa GP1 mataas
isa ito ay dapat GP2 Mataas NGUNIT hindi ito gumana tulong Anumang ay b appricciated
Code:
listahan p = 12C508A # include __ config _MCLRE_OFF & _CP_OFF & _WDT_OFF & _ExtRC_OSC RESET_VECTOR CODE 0x1FF; processor-reset vector simula movlw 0x38; b'111000 'TRIS GPIO; Set GP0, 1,2 Bilang output GP 3,4,5 Bilang input Tumawag Sw1on Sw1ON movlw 0x01; GP0 Hight movwf GPIO; na humantong Konektado sa GP0 Ilaw Sa pumunta Sw1on
Code:
0x02 Sw1ON movlw; GP1 Hight movwf GPIO ; LED Konektado sa GP1 Ilaw Sa pumunta Sw1on
Code:
0x04 ng Sw1ON movlw; GP2 Hight movwf GPIO; LED Konektado sa GP2 Ilaw Sa pumunta Sw1on