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.

urgent help needed for pic16f877 programming

Status
Not open for further replies.

bythesea

New Member
i'm a beginner in pic programming and i would greatly appreciate any help given.

i need to generate a waveform using pic16f877 which looks like this **broken link removed** as shown on page3. how can i do this?

i have not done pic programming before and even though i have looked through the datasheet a few times, i'm none the wiser.

i'm using C to program the chip using the mplab and hitech-picc interface. i had been stuck for more than a week and i really hope to achieve some progress very very soon.

thanks a lot in advance
 
bythesea said:
i'm a beginner in pic programming and i would greatly appreciate any help given.

i need to generate a waveform using pic16f877 which looks like this **broken link removed** as shown on page3. how can i do this?

i have not done pic programming before and even though i have looked through the datasheet a few times, i'm none the wiser.

i'm using C to program the chip using the mplab and hitech-picc interface. i had been stuck for more than a week and i really hope to achieve some progress very very soon.

thanks a lot in advance

Well for a start you will need extra hardware, the PIC runs off +5V and you need +20V and -20V outputs. Also, assuming you need the changes from +ve to -ve to be gradual (as the diagram shows) you will also need a digital to analogue converter. If all you need to do is switch the output high for a certain time (+5V) and low for a certain time (0V) it's very easy to write the code for.
 
Nigel Goodwin said:
bythesea said:
i'm a beginner in pic programming and i would greatly appreciate any help given.

i need to generate a waveform using pic16f877 which looks like this **broken link removed** as shown on page3. how can i do this?

i have not done pic programming before and even though i have looked through the datasheet a few times, i'm none the wiser.

i'm using C to program the chip using the mplab and hitech-picc interface. i had been stuck for more than a week and i really hope to achieve some progress very very soon.

thanks a lot in advance

Well for a start you will need extra hardware, the PIC runs off +5V and you need +20V and -20V outputs. Also, assuming you need the changes from +ve to -ve to be gradual (as the diagram shows) you will also need a digital to analogue converter. If all you need to do is switch the output high for a certain time (+5V) and low for a certain time (0V) it's very easy to write the code for.

Nigel,

thanks a lot for the reply.

the output of the chip goes into an amplifier so this is not of a big concern...yet. i'm now more worried about getting the exact shape of the waveform adhering to certain rise time and fall time.

you mentioned about D-A converter. why is it necessary?

my initial idea is to write a simple straight line equation for each portion of the waveform. (is Y = mX + c). is such an idea feasible? if so, can you guide me to how i can proceed?
 
you mentioned about D-A converter. why is it necessary?

DA converter is necessary to create the gradual rise in voltage output, with digital you only get the 2 voltage levels so you wouldn't get this. But as Nigel said that's only assuming that you want your output to be exactly like the diagram, if you just use digital levels the voltage will go straight up on such a timescale so it wouldn't have the slope like the graph shows.
 
ChriX said:
you mentioned about D-A converter. why is it necessary?

DA converter is necessary to create the gradual rise in voltage output, with digital you only get the 2 voltage levels so you wouldn't get this. But as Nigel said that's only assuming that you want your output to be exactly like the diagram, if you just use digital levels the voltage will go straight up on such a timescale so it wouldn't have the slope like the graph shows.

thanks for the explanation..i think i'm beginning to understand

despite my limited understanding, i'm still very unsure about implementing it. my main problem has to be dealing with the time scale. for example, suppose the slope rises from 0 at t=0 to 50 at t=4. how do i implement it using the DAC and the microcontroller?

can someone provide me any guidance?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top