|
|
Help with this PIC code
Hi,
i want your opinion about this code for PIC24FJ32GB002...I want to use
internal FRC for bus clock at 8MHz and obtain a PWM output at
150KHz...this is my first pic code and i can't test it (i haven't any
evalboard)...what do you think? This is my code
#include <P24FJ32GB002.h>
#define DEBUG
_CONFIG2(IESO_OFF & FNOSC_FRC & POSCMOD_NONE)
_CONFIG1(JTAGEN_OFF & ICS_PGx2 & FWDTEN_OFF)
int main (void)
{
CLKDIV=0x00; //clock divisor 0 => 8MHz
#ifdef DEBUG
REFOCONbits.ROEN=1; //to see clock on REFO pin
#endif
//---150KHz PWM---
OC1CON2bits.SYNCSEL=0b00000; //free running
OC1RS=25;
OC1R=25/2; //50% duty cycle
OC1CON1bits.OCTSEL=0b111; //system clock
OC1CON1bits.OCM=0b110;
__builtin_write_OSCCONL(OSCCON & 0xBF);
RPOR1bits.RP3R=18;
__builtin_write_OSCCONL(OSCCON | 0x40);
while(1);
return 0;
}
I've tried to test my firmware with mplab with logic analyzer, but
notihing comes out from REFO pin, so i need your opinion...what do you
think?
Thanks
|
|
0
|
|
|
|
Reply
|
idkfaidkfaidkfa (13)
|
1/3/2011 6:08:41 PM |
|
Em 3/1/2011 16:08, eryer escreveu:
> Hi,
> i want your opinion about this code for PIC24FJ32GB002...I want to use
> internal FRC for bus clock at 8MHz and obtain a PWM output at
> 150KHz...this is my first pic code and i can't test it (i haven't any
> evalboard)...what do you think? This is my code
[snipped]
Get a look at http://eng-serve.com/pic/pic_timer.html
HTH
--
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/
|
|
0
|
|
|
|
Reply
|
csrabak6676 (57)
|
1/3/2011 7:16:43 PM
|
|
On 3 Gen, 20:16, Cesar Rabak <csra...@bol.com.br> wrote:
> Em 3/1/2011 16:08, eryer escreveu:
>
> > Hi,
> > i want your opinion about this code for PIC24FJ32GB002...I want to use
> > internal FRC for bus clock at 8MHz and obtain a PWM output at
> > 150KHz...this is my first pic code and i can't test it (i haven't any
> > evalboard)...what do you think? This is my code
>
> [snipped]
>
> Get a look athttp://eng-serve.com/pic/pic_timer.html
>
> HTH
>
> --
> Cesar Rabak
> GNU/Linux User 52247.
> Get counted:http://counter.li.org/
Thanks for answer, but PIC16F is very different from 24F: so link
isn't useful...
|
|
0
|
|
|
|
Reply
|
idkfaidkfaidkfa (13)
|
1/4/2011 8:07:23 AM
|
|
|
2 Replies
51 Views
(page loaded in 0.073 seconds)
Similiar Articles: How to insert a picture in to a GUI - comp.soft-sys.matlab ...Someone can help me out? (this picture can be .fig, bmp, or jpg format). One way I try to use ... to do the simple particle sizing demo, but if you delete that demo code ... Help with retrieving pixel values - comp.soft-sys.matlab ...... and store the pixel values of mouseclick on the picture. ... ... here are the code snippets.... handles.display ... set(t,'Data',vals); > > > Can anyone help me with ... How to resize image using javascript codes - comp.graphics.apps ...Hi All, Could you pls help me how to resize image to ... found that 15% is good if you still want a quality picture. ... like to rescale the image size for ... here is my code ... how do you put images on a screen? - comp.lang.java.help ...can someone give me some simple code only showing me how to ... how do you put images on a screen? - comp.lang.java.help ... How Do I Add a pointer or arrow to a picture ... any matlab function/source code for huffman encoding - comp ...My need is to see a 16x16 picture block, if using Huffman encoding... needs how ... and Receiver) for this I have to design some blocks in Matlab can anyone help to code ... Fuel Spray Angle Measurement - comp.soft-sys.matlabAnd repeat the process for the bottom half of the picture but I have no idea how to start writing the code for that or if it's even the correct way to do it. Some help ... Including an area into a circle - comp.soft-sys.matlabThe code that I got to before I asked for help here is I = imread('proba41.jpg ... > > > > Can you give the code to go from your original picture to the > > segmented ... RedBack HP-UX 11 - comp.sys.hp.hpux... soft-sys.matlab i want to segment a video clip into shots using matlab code.can anyone help ... Alan D Johnson; Rick Jones; connect; Reg PIC code. jignaasu; sunil; remote X ... color detection in matlab - comp.soft-sys.matlabIf you still need help, post your code. Or you could simply take the histogram of ... port/ you can use this link for parallel port interface to PIC hope it would be help ... INSERT PICTURE INTO A CONTAINER FIELD DYNAMICALLY - comp.databases ...Is it possible to insert a picture into a container field ... re in FMP7, look at "Defining File References" in Help. ... I can hard-code a file reference, or a file name. HTML Picture CodesHTML Help/Cheat Sheet HTML Templates More Codes... HTML Generator HTML Table ... More Picture Codes. Here are links to more picture codes. You can do things like hyperlink ... PIC Programming - YhteystiedotHere are 4 steps to help you get started with PIC programming. Note: I haven't used this ... Get example code and build a test circuit The best way to learn is by ... 7/27/2012 12:38:32 AM
|
|
|
|
|
|
|
|
|