Hello,
The best way to learn C is to create programs in Flowcode and then refer to the C code file to see what is being generated. There is a manual on the BoostC compiler available from the "Flowcode v4\Boostc" directory.
Ports and configuration registers have all been defined for you. Simply usse the register name in lower case.
EG.
trisa = 0x00;
porta = 0x55;
You might be better off keeping the value as two bytes to make it easier to send through the RS232.
Eg.
FCV_CCPL = ccpr1l;
FCV_CCPH = ccpr1h;
or to combine into a single integer variable.
FCV_CCP = ccpr1h << 8;
FCV_CCP = FCV_CCP | ccpr1l;
Include and List Commands?
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Include and List Commands?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 18
- Joined: Fri Feb 26, 2010 5:05 am
Re: Include and List Commands?
thank you for your information
please suggest me .
i am reading from input from pin RC5/CCP1. i want to capture input signal from this RC5/CCP1.captured value i want copied into variable .
i am using pic 16f946 and timer1 of pic micro-controller.i written custom interrupt but it is not working.any suitable example related please send me
please suggest me .
i am reading from input from pin RC5/CCP1. i want to capture input signal from this RC5/CCP1.captured value i want copied into variable .
i am using pic 16f946 and timer1 of pic micro-controller.i written custom interrupt but it is not working.any suitable example related please send me
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Include and List Commands?
Hello,
Please can you ensure you are posting your questions in the relevant topic. IE the Flowcode topic related to your version.
Please can you ensure you are posting your questions in the relevant topic. IE the Flowcode topic related to your version.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 18
- Joined: Fri Feb 26, 2010 5:05 am
Re: Include and List Commands?
i written flow code for capture input signal
i am using 16f946 pic micro-controller RC5/ccp1 is capture input
1. IN c-code i configured registers.
osccon=0x77;// initializes internal oscillator
lcdcon=0x00;//reset lcdcon register for port c
trisc.5=1;// bit RC5 configured as a input
t1con=0x23;//i set timer1 con register value
ccp1con=0x04;// i set ccp1con for every falling edge to capture
intcon.PEIE=1;// peripheral interrupt enable bit
intcon.GIE=1;// global peripheral interrupt bit of intcon
2. after i call custom interrupt for capture signal
enabel code
intcon.PEIE=1;
intcon.GIE=1;
pie1=0x00;
pir1=0x00;
handler code
if(pir1&(1<<CCP1IF))
{
FCM_%ccp1();ccp1 is maro function
clear_bit(pir1,CCP1IF);
}
in ISR just i want to copy captured value into some variable and display on computer through RS 232 .
i attached .fcf file please go through it suggest me what can i do
i am using 16f946 pic micro-controller RC5/ccp1 is capture input
1. IN c-code i configured registers.
osccon=0x77;// initializes internal oscillator
lcdcon=0x00;//reset lcdcon register for port c
trisc.5=1;// bit RC5 configured as a input
t1con=0x23;//i set timer1 con register value
ccp1con=0x04;// i set ccp1con for every falling edge to capture
intcon.PEIE=1;// peripheral interrupt enable bit
intcon.GIE=1;// global peripheral interrupt bit of intcon
2. after i call custom interrupt for capture signal
enabel code
intcon.PEIE=1;
intcon.GIE=1;
pie1=0x00;
pir1=0x00;
handler code
if(pir1&(1<<CCP1IF))
{
FCM_%ccp1();ccp1 is maro function
clear_bit(pir1,CCP1IF);
}
in ISR just i want to copy captured value into some variable and display on computer through RS 232 .
i attached .fcf file please go through it suggest me what can i do
- Attachments
-
- timer1.fcf
- (8 KiB) Downloaded 267 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Include and List Commands?
Hello,
Again, Please post Flowcode questions into the Flowcode section of the forums. We will not answer Flowcode related questions outside of these topics.
Again, Please post Flowcode questions into the Flowcode section of the forums. We will not answer Flowcode related questions outside of these topics.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Include and List Commands?
Here is a program that will trigger on your custom interrupt and return the timer 1 count via rs232.
- Attachments
-
- timer1.fcf
- (14 KiB) Downloaded 278 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel