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.

Help needed ASM to HEX with MPLAB

Status
Not open for further replies.
Nigel

Thanx, got TK3 running, just need to figure it out, so this can do the TASM to hex?

Thanx

Virus
 
Nigel

I programmed the chip and verified the data again.. But it is as dead as a doornail when plugged into the PCB. There is 5V+ and 5V- as required.

I is a Pic16F877 it is run with a 3.2768 Mz crystal, is it XT mode ?

Can the programmer verify the data correctly in a PIC if the pic is faulty?

How can I check if the chip is starting up ?

Sorry for all the Q&A.

Virus
 
There are a few reasons why the file might not work. Orging the code at location 4, assuming decimal radix, not having a config value etc.

Here is a cleaned up version that will compile in MPLAB.

Mike.
 
Last edited:
Mike Morning

I have 0 programming experience.

I did use TK3, and converted the code to MPSAM, used MPLAB complied the code with 0 errors, programmed the chip, and it is not working.

Attached code as converted by TK3 for MPasm.

The DIY128 programmer that I use does not give me all the switches (fuses) options that the TK3, and the project suggest that need to be set.

Can the switches be set in software ?

I believe the chip does not startup, in the construction check out they state that if the LCD is connected with only the power regulator IC’s that the LCD will only have 1 line displaying. The LCD only displays 1 line as in the checkout, with the PIC F877 plugged in it still stays the same, also none of the controls interfacing with the F877 is working, because measuring the output socket I can read the same value as the MAX038 is generating on PIN19.

Can the F877 be dead ?, how do I test it, but it then would not program right ?

Any suggestions where to start, I have checked and dubbel checked the hardware.

Thanks

Virus
 

Attachments

  • PIC-GEN_M.ASM
    36.6 KB · Views: 242
Mike

Thanks, haven seen the attachment. Will do necessary, and get back.

Thanx

Virus
 
Mike

The code does not complie to HEX and either in TK3 or in MPLAB.

It is a PIC16F877 not A, would that make a difference

Virus
 
You need to change these three lines and then it should compile,
Code:
	list		p=16f877	; list directive to define processor
	#include	<p16f877.inc>	; processor specific variable definitions
	
	__CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _XT_OSC & _WRT_ENABLE_ON & _LVP_OFF & _DEBUG_OFF & _CPD_OFF

And, of course, select the 16F877 on the configure menu.

Mike.
 
Mike / Nigel

A cold one on you guys, or maybe just for Mike and myself, Nigel must be freezing up their.

Thanx it seems to be working fine, The F877 is controlling the Max038 etc. Still 0 on the LCD, but I think it is wiring and will sort it out and get back with a photo or two.

I need more info though. The PICGEN is giving me a square, tri and sine wave with + and – values as seen on the scope. How can this be changed to just positive offset, software?, or need it be done with a 555 or something similar that can handel 0.1 Hz to ± 4Mtz. From their I want drive a couple of mosfets (have plenty of IRF540) to drive a air coil at 24volt ± 5-10 amps.

Any suggestions or should I post it some where els.

Thanx

Virus
 
Last edited:
Good to hear it's finally working.

Have you a link to the circuit diagram?

Mike.
 
Will do you 1 better, find attached

Thanx

Virus
 

Attachments

  • PIC-GEN FREQUENCY GENERATOR Short.pdf
    1.1 MB · Views: 500
Mike

What I am working to is to build a project that uses a keypad to enter frequencies into it and then generate a positive of-set square pulse. Possibly with some memory that will store a couple of frequencies sets.

Is this a difficult project ?, I am looking for a circuit diagram, or something similar that I can maybe adapt, have you come across something similar ?

Thanx

Theunis
 
Last edited:
Any one wanting to build the PIC-Gen, please make sure you get the components first, some are outdated ex.(MAX038 got the last 3 from a supplier, etc).

Virus

PS: Also1 off the 0v pins on connector TB1 in Fig.2. need to be connected to LCD pin 5 or the R/W pin. The other to PIN 1 VSS.
 
Last edited:
Virus said:
Mike

What I am working to is to build a project that uses a keypad to enter frequencies into it and then generate a positive of-set square pulse. Possibly with some memory that will store a couple of frequencies sets.

Is this a difficult project ?, I am looking for a circuit diagram, or something similar that I can maybe adapt, have you come across something similar ?

Thanx

Theunis

This doesn't sound like something that will be readily available and I think you will have to write the code yourself. It looks like you could have a steep learning curve ahead. Have you done any other programming before?

Mike.
 
No programming experience at all, not even electronics, I have read a lot and have built some projects etc pic-gen most advanced for me until now, believe I will get their some time. (All though time it self might catch up with me first.)

I intend to start learning programming asap, how fast, I doubt that I will ever be able to reach that high my self. I have master Proteus and can make PCB’s from exiting schematics, can make my own films (have a image setter and processor) for making the PCB, etching an all the necessary.

Therefore the pic-gen closest to what I intend and could maybe do for now.

Back to the positive-offset on the square wave, any suggestions.

Virus
 
I wanted to use the pic-gen but as mentioned it generates as pos and negative value, I need to get a positive dc offset square puls, from between 0.1 Hz to ± 4Mhz. Wanted to use the pic-gen to drive a 555 or something similar that will give a positive puls, and in turn then drive a Mosfet or two that will puls a air coil at about 24vDC at 5 -10 amps.

Won’t it work to just drive the mosfets directly, because they can only be on or off. The spec on the Pic-gen says it can give +5v, is that enough to drive the mosfets full out.

Thanx

Virus
 
What do I need to change it to have a positive offset ?

Virus
 
I found this circuit, can I use the square wave output from the Pic-Gen to drive this circuit.
I only have IRF540’s can I use them instead of the HUF75337P9 mosfets.

Virus
 

Attachments

  • Coil Driver.png
    Coil Driver.png
    38.2 KB · Views: 332
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top