Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC-Programmer 2 for PIC16C84, its software & compiler???

Status
Not open for further replies.
Measure voltage at the port in wrt Gnd, instead of across the LED. perhaps the port pin output is Low at that moment.
 
Last edited:
The code I posted the delay may not be long enough to see it blink here new code shows how to use delay_ms
Code:
#include <htc.h>
	__CONFIG (FOSC_HS & CP_OFF & WDTE_OFF & PWRTE_ON );
#ifndef _XTAL_FREQ
 // Unless already defined assume 4MHz system frequency
 // This definition is required to calibrate __delay_us() and __delay_ms()
 #define _XTAL_FREQ 4000000
#endif
void init(void)
{
// port directions: 1=input, 0=output
TRISB = 0b00000000; //set's portb to output
RB0 = 0;  //starts RB0 off
}
void main(void) //main code atfer here
{
init(); //runs startup code
while (1){  //loop
RB0 = 1;    // turns led on
__delay_ms(1000); //delay
RB0 = 0;      // turns led off
__delay_ms(1000);  // delay
}
}

Here the hex to just in case your doing something wrong you can try it to see it work
Code:
:02000000D62BFD
:1007AC008301DD2B83168601831206100800D823E3
:1007BC00DF2B8312061406308E0013308D00B130FF
:1007CC008C008C0BE72B8D0BE72B8E0BE72BEE2B7A
:1007DC008312061006308E0013308D00B1308C0061
:1007EC008C0BF62B8D0BF62B8E0BF62BFD2BDF2BA0
:0407FC00DF2B0028C7
:02400E00F2FFBF
:00000001FF
 
sorry.
there is nothing on that screen. all 3FFF, Probably while selecting the hex file you did not give p[roper routing. please check where is the hex file located, after compiling?
 
Last edited:
He not doing something right looks like he didn't load any thing but a blank.?
 
yes Burt, perhaps lack of understanding on the process. Hope that he would realise the process sooner.
 
I no the code works I dug out a old board with a 16f84 on it and tried it. Just to make sure and it worked in MPLAB sim.

I would keep my files at C:\ Mycodes so you can find it Mycodes being what ever you want to name it if your running XP.
 
Last edited:
now from start i m telling what actually i did. I took burt code and place on mplab & saved it in d: then i selected new project & then gave it a place in d: & then selected Hi-tech compiler and then start doing work.I selected my saved file in other files option & compiled it & then exported the file & selected file format named intel 32 bit hex (INHX32) & then saved in d: & then opened winpic800 & loaded the file which i exported & that was with the extension of HEX,now plz tell me where was the mistake.



regards
Hassan
 
You don't export any thing When you compile the file with MPLAB it makes a HEX Like the one I posted for you I'm going to zip up my files all you have to do is download them and unzip them
where you want them. Then use winpic800 to load the hex it's called blink84.hex

You can open the mplab project file and MPLAB will open it just Like I did it But just try to load the hex thats in it
 
yeah actually my xp pc is not working properly for net then i took picture from that pc & send it by my laptop and edited on win7 thats y.
now tell me plz
 
Did you unzip the file I posted ? try to use the hex in it
 
Last edited:
please locate the hex file created recently.
zip and upload it let us examine, Hassan saheb !!

i believe the code should be in intel 8 bit hex format
you machine is 32 bit, but 16F84A micro-controller can't manage 32 bit !!
 
Last edited:
i fear, Mr Hasan, you are not =understanding the issue.
the PIC16F84A ids an 8bit mid range microcontroller
the data sheet would indicate that you have to seek from the compiler, Intel HEX8 and not intel hex 32.

use burt's hex and as you go down the window of winpic800\ the code is seen at the last. in your file the code is not seen at the same or no other location.
 
Last edited:
yeah i know that but the problem is that if i select intel 8 bit then it forms two splitted files with extension of HXH & HXL,then what should i select in winpic800?
 
yeah i found something in the last when i used burt's code in winpic800 & i have programmed by that, is it fine now?
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top