PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Microchip PIC development boards and accessories
Anobium
Posts: 20
Joined: Fri Aug 01, 2014 9:17 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by Anobium » Wed Aug 06, 2014 6:46 pm

@Brinn. Pop over to the Great Cow Basic website. Post a message in the Help section. If you want to stay with Mplab then please ignore this advice.

andrew
Site Admin
Posts: 788
Joined: Sun Aug 05, 2012 4:15 pm

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by andrew » Fri Aug 08, 2014 9:33 am

We've now added a quick start guide to installing Great Cow Basic in the software section of the forum. A link to it has now been added to the first post of this forum.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

barewires
Posts: 49
Joined: Wed Aug 21, 2013 7:38 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by barewires » Tue Sep 09, 2014 3:12 pm

i just used one of these and erased the led flashing programe on the pic chip which came with it ,where can i find it again to load it up ?
I believe that test program is flashed into the device by the factory when board is tested. I'm about to add an example blink program to the first post. Unfortunately I can't test it right now so feedback would be appreciated.
I captured a .hex file (and reduced it to the bare minimum size by ignoring blank code) of the flashing LED demo when my PIC Development Board + PIC16F877A (HCDVBD0003) kit arrived. Just save this as 877aDemoLed.hex file and import it into your PIC Programmer V2. Make sure that the LED-EN J3 Jumper is in place to power the LEDs through the 8 dropping resistors.

Code: Select all

:100000002030840025300A200A128A11E72F0406C6
:100010008001840A0406031D072864000034FF3FA2
:100FB0008301A300E22F0A30A400A403240FDD2F35
:100FC000A20BDB2F83120313A30BE02F0800FF30CB
:100FD00083120313A1008316880183128800FF3057
:100FE000A100A00121088800C830A2000A30D8273B
:100FF0000310A10CA00A093020020318EF2FF22FD2
:02400E00323F3F
:00000001FF
21/10/2014: I have verified this code fragment and it compares exactly to the 'full' code, providing the chip is erased first. This was done with 3 different programmers: the real Microchip PICkit2, HC PIC Programmer V2 and HC K150. I have not yet tried it with my PICkit3 but will report later.

The reason I only show this reduced Intel Hex data is to allow a new programmer to get familiar with the format. An empty chip is all 1s; 3FFF hexadecimal, a 14 decimal bit value.

http://en.wikipedia.org/wiki/Intel_HEX

Now where does this following line of hex code actually get loaded?
:100FB0008301A300E22F0A30A400A403240FDD2F35
gets broken down to
: 10 0FB0 00 8301 ....... 35

The Intel Hex format is:

: Start of line

10 Byte Count in hexadecimal is 16 decimal bytes.

0FB0 is start location, then divide by two, so 0FB0 / 2 = 07D8 the actual load address of this line of code. This address is most significant byte first.

00 Record Type. This line now contains data and a 16-bit starting address for the data.

8301 is the PIC code 0183, remember code is now least significant byte first. This equates to the instruction CLRF STATUS.

35 checksum

CR/LF carriage return / line feed

This was intended to help but only shows the illogic of microcomputer tool designers. It is, however, essential knowledge if one is to do low-level debugging and patching.
Last edited by barewires on Fri Oct 24, 2014 11:33 am, edited 10 times in total.

brinn
Posts: 11
Joined: Sat Jul 26, 2014 9:51 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by brinn » Tue Sep 30, 2014 3:19 pm

sill no luck gettin it to build always fails

CLEAN SUCCESSFUL (total time: 249ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/nobody/MPLABXProjects/ledtest.X'
make -f nbproject/Makefile-default.mk dist/default/production/ledtest.X.production.hex
make[2]: Entering directory 'C:/Users/nobody/MPLABXProjects/ledtest.X'
"C:\Program Files\HI-TECH Software\PICC\std\9.60\bin\picc.exe" --pass1 newfile2.c -q --chip=16F877A -P --outdir="build/default/production" -N31 --warn=0 --runtime=default,+clear,+init,-keep,+osccal,-resetbits,-download,-stackcall,+stackwarn,+ramtest,+clib --summary=default,-psect,-class,+mem,-hex --opt=default,+asm,-asmfile,9 --double=24 --float=24 -g --asmlist "--errformat=%f:%l: error: %s" "--msgformat=%f:%l: advisory: %s" "--warnformat=%f:%l warning: %s"
make[2]: *** [build/default/production/newfile2.p1] Error 4
make[1]: *** [.build-conf] Error 2
(1187) invalid activation request
make: *** [.build-impl] Error 2
nbproject/Makefile-default.mk:97: recipe for target 'build/default/production/newfile2.p1' failed
make[2]: Leaving directory 'C:/Users/nobody/MPLABXProjects/ledtest.X'
nbproject/Makefile-default.mk:75: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/nobody/MPLABXProjects/ledtest.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 561ms)

i didnt change over to GCb YET AS I WANT TO STICK WITH MPLAB X

brinn
Posts: 11
Joined: Sat Jul 26, 2014 9:51 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by brinn » Tue Sep 30, 2014 3:39 pm

I TRIED LOADING THE HEX FILE VIA PICKIT 3 BUT I GET AN ERROR ABOUT THE VOLTAGE AND THEN IT WONT LOAD DUE 'TO PROGRAM FAILED AT MEMORY ADDRESS 0X000000' MESSAGE

Anobium
Posts: 20
Joined: Fri Aug 01, 2014 9:17 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by Anobium » Tue Sep 30, 2014 8:10 pm

When you load Pickit3 are you getting the correct chip selected automatically?

And, please try the attached HEX file. This was my original hex file. I believe the file above may not be complete.
You do not have the required permissions to view the files attached to this post.

brinn
Posts: 11
Joined: Sat Jul 26, 2014 9:51 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by brinn » Tue Sep 30, 2014 9:22 pm

thanks now the hex file works ok .just need to get MPLBX sorted then i am up and running ,but i can get by just using hex file examples till then ,what a relief.
it been a long haul so far

Anobium
Posts: 20
Joined: Fri Aug 01, 2014 9:17 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by Anobium » Thu Oct 02, 2014 5:05 am

Good luck.

brinn
Posts: 11
Joined: Sat Jul 26, 2014 9:51 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by brinn » Thu Oct 02, 2014 6:52 pm

more trouble with a program creation for the 877A in MPLABX ,CREATING the source file seems ok but where do i find the 877A MCU header file ?
??
and when i have the source file and header file do i need anything else ??

Anobium
Posts: 20
Joined: Fri Aug 01, 2014 9:17 am

Re: PIC - PIC Development Board + PIC16F877A (HCDVBD0003)

Post by Anobium » Thu Oct 02, 2014 7:02 pm

@Brinn

I cannot help with MPLAB. I know use MPLAB for debugging ASM files and low level chip emulation.

Really sorry.

Post Reply