Author Topic: Proteus 16f876 calculator  (Read 9838 times)

Olakunle

  • Member
  • ***
  • Posts: 17
Proteus 16f876 calculator
« on: May 06, 2015, 05:37:10 pm »
please I tried to recompile the proteus Calculator C code originally for pic16f876 now for pic 16f877.
the reason why I did this was because proteus only gave us a .d39 file from the iar c compiler. this .d39 file is not programmable into a real life pic since real life pic programmers only accepts a hex file. so I was able to obtain a hex file for the pic 16f877 used in that calculator circuit. the hex file was 17kb. I am using a serial pic programmer developed by one of my friends. the problem am having is that when I tried to program a real life pic with the hex only 11 bytes was written and verified and the programmer stopped programming. the same thing happened to a 7kb hex file which only write 2 bytes and then stop. I could program an hex file from an assembled file unlike the c file above into the same pic. please what are the likely problems. thanks.
Olakunle

Olakunle

  • Member
  • ***
  • Posts: 17
Re: Proteus 16f876 calculator
« Reply #1 on: May 06, 2015, 05:43:37 pm »
I mean what are the likely problems and solutions.
l

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Proteus 16f876 calculator
« Reply #2 on: May 07, 2015, 10:54:17 am »
If you can program other hex files, it sounds like the problem is with the format of the hex files that are failing. A web search on

hex file

will tell you more about the format.

Olakunle

  • Member
  • ***
  • Posts: 17
Re: Proteus 16f876 calculator
« Reply #3 on: May 10, 2015, 02:02:40 pm »
I would like to thank you for mentioning that the hex file format might be the problem.
I have actually thought so before but I couldnt confirm that there are other hex file formats after some Internet Searches.
So what I did was to go to the options>output tab of the microc compiler. there I was able to change the output type to long hex file format.
after doing this, I was able to generate an hex file similar to the one from the assembly hex file and I was able to write the
newly generated 2896 bytes long hex file format hex file to the pic 16f877 microcontroller.
Both the old hex file and the newly generated long hex file format hex file worked correctly on proteus.
Now that the 16f877 has been programmed, the problem that came up was that although the code work in proteus
it doenst seem to work in real hardware. my reset logic level, Vcc and ground are all at the appropriate voltage.
I tried changing the crystal, the problem still persist and the crystal capacitors are well inserted.
Please how should I solve the problem of making microc hex file work in real hardware. Thanks.
Olakunle


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Proteus 16f876 calculator
« Reply #4 on: May 11, 2015, 08:08:11 am »
I'm glad to hear you were able to copy the hex file. The Microchip forums might be a better place to find help with problems in getting the code to run:

http://www.microchip.com/forums/