Good evening,
Do some body know, or have, a code, a subroutine in MikroC in order to test rapidly the availability of the chip. In others word is there a code which test the PIC 16F877.
Probably, after many experiments and reloads of the hex code in the memory, the PIC runs strangely. Before my routines and code did run properly (PWM with LED and buzzer, LED and switches, servomotors, joystick and LEDs ...). But know each code runs partially, not properly.
i use MikroCPro For PIC. I erased many times the memory, I reloaded compiled source, hex file again ... But still same.
Merci beaucoup for help !
Éric
Dear HexReader,
Sorry, yes it is PIC 16F877A.
With MikroC For PIC :
1) Build > Build -> Finished successfully.
2) Build > Build + Program -> MikroProg Suite window :
Oscillator : HS
-> My oscillator frequency is 4 MHZ. Oscillator should be set up to XT ?
-> Watchdog Timer : Disabled.
When I click on Verify button I get « There are no difference. Verification SUCCESS »
When I switch Oscillator to XT and click on Verify button I get « Differences found ! Config. Word(s) : 1 Error(s) »
While waiting your answer I will have a look and runs your attached zip file.
Merci beaucoup !
Provided the configuration bits are set properly and dual-purpose pins are made digital outputs it should work but it doesn't really test the IC, it just gives an idea of whether it can run or not.
If you want better testing you need to scan through the memory and keep a CRC count of locations then pass values through the registers and read/write all the RAM locations. It can be tricky with Harvard architecture because program memory and user memory are not mapped in the same way but a good degree of confidence can still be achieved.