changing parameters in .fcd files ?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm
Contact:

changing parameters in .fcd files ?

Post by chevy6600 »

Hi all, can you point me in the right direction please. I would like to play about with changing the 18F2620 .fcd parameters, i have previously altered the `adcon1` register as per a previous posts to enable a `vref ` , now i wanted to play about with the `cvrcon` register but when i altered the `18F2620_vref.fcd` file (my version) then did a recompile, and when i did a test using `proteus` there did not appear to be any difference. :cry: So to check whether i was altering the correct .fcd file (original .fcd file was kept as standard, using my copy of it) i renamed it adding an `x` either side ...x18F2620_vref.fcdx.... but both flowcode and proteus recompiled and ran as normal :!: . I expected both flowcode and proteus to bring up an `error` message as it should of looked for the file to add to the program. I then renamed the original fcd file using `xx` as well only to find that flowcode/proteus still did not throw up an error message and as such i do not believe these fcd files are being used by my programing!...i have `searched` the hard drive for any other similar named files but non were found. I did find files used by `boostc` with extensions `tdf, h,` and `bas` but these do not look as though they are what i need.

A) please tell me if i am looking for the correct file to add my `vref ` using the `adcon1 `

B) would i just add the `cvrcon = 9f ` as per. " ADCCapture="char ta, tb, cnt;\ncvrcon = 0x9f;\nadcon1 = 0x01;\nadcon2 = 0x03;?

User avatar
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: changing parameters in .fcd files ?

Post by Benj »

Hello Chevvy

The FCD file name appears as a device in the target list. Eg if you make an FCD file named 18F2455_ben1.fcd then it would appear as 18F2455_ben1 in the target device list.

You will need to restart Flowcode for it to detect any modifications in the current target device FCD file. This could be what is causing the problem.
ADCCapture="char ta, tb, cnt;\ncvrcon = 0x9f;\nadcon1 = 0x01;\nadcon2 = 0x03.....
Also your code for configuring the cvrcon register looks fine.

chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm
Contact:

Re: changing parameters in .fcd files ?

Post by chevy6600 »

BINGO success, :lol: your suggestion to restart flowcode worked.
Thanks

chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm
Contact:

Re: changing parameters in .fcd files ?

Post by chevy6600 »

HI all, i have been playing around trying different maths to produce the PWM, the problem i was having was that as a potentiometer was advanced 1% step at a time, the pulse would keep in step for about 4 steps then when the potentiometer advanced another step the PWM either reversed 2 or 3 steps or ignored the extra step etc..etc..

I found a series of maths functions that seemed to work quiet well....every 4th step was ignored. which may be acceptable, at least it does not reverse !. :|
What i ended up doing was to use a number of multiplications and although the pic 18F2620 has a hardware multiplier which can do 8*8 multiply in 1 cycle i wondered if the program was actually using the hardware multiplier or is it done by software :?: as i do not really recognise any code in the pic.fcd file that lends itself to it. If it does not is it fairly easy to add some entries into the pic.fcd file ?.
I realise that hardware multiplication will not help the linear movement of the PWM but i will not worry about using many multiplications using up the bandwidth.....i understand the software way can take something like 63 times as many steps compare to the hardwares 1 step :!: :!:
thanks.

chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm
Contact:

Re: changing parameters in .fcd files ?

Post by chevy6600 »

Hi all, i have managed to sort it out` , i was trying to find the `mulwf ` in the generated assembler code which as i understand is the hardware multiply and i could not find it in the test program i setup. But it appears that it only appears if you do a multiply in flowcode in a certain way. Once i put the multiply arguments into variables the `mulwf` showd up, so now that i know that the hardware multiply works i`m not too `fazed` by us using a number of multiplications. 8)

[/b]
chevy6600 wrote:, ................and although the pic 18F2620 has a hardware multiplier which can do 8*8 multiply in 1 cycle i wondered if the program was actually using the hardware multiplier or is it done by software :?: as i do not really recognise any code in the pic.fcd file that lends itself to it............

Post Reply