Hi, Ive connected a PIC16F87 up in the same way i always do and ive put a test program on but its not doing what i want it to. Ive checked the obvious things. The resonator is the correct value, MCLR is held high through a 10K resistor, The fuses are set correctly, The correct chip is selected in microcode studio and the programmer software.
Heres my test code
I would expect the 3 outputs to turn on and off once every second. Instead they are all flickering at varying frequencies.Code:'Define the oscillator (20MHz) DEFINE OSC 20 'Set the tris registers TRISA=%00000011 TRISB=%00000100 'Define output pins pSocket1 VAR PORTA.2 pSocket2 VAR PORTA.3 pSocket3 VAR PORTA.4 pSocket4 VAR PORTB.0 pSocket5 VAR PORTB.1 pSocket6 VAR PORTB.3 pPower VAR PORTB.7 pStatus VAR PORTB.4 pData VAR PORTB.6 'Switches between Master and Slave 'Define input pins iSensor1 VAR PORTA.0 iSensor2 VAR PORTA.1 'BEGIN: Main loop loop: high ppower high pstatus high pSocket6 pause 500 low ppower low pstatus low pSocket6 pause 500 GOTO loop
Ive tried multiple PICs and ive replaced the resonator but with no change
Im sure ive had this exact problem before when running the pause command but ive searched the forums and i cant find any posts about it.




Bookmarks