Timer 1 for 12F675

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

User avatar
1Handypal
Flowcode v5 User
Posts: 41
Joined: Fri Jan 06, 2012 8:17 am
Has thanked: 8 times
Contact:

Re: Timer 1 for 12F675

Post by 1Handypal »

Hello guys and gals(if any),
I have not been able to test anything out yet. Thanks to all for your valuable input and support.
I might have a chance tonight and will let you know the results.
Best.

User avatar
1Handypal
Flowcode v5 User
Posts: 41
Joined: Fri Jan 06, 2012 8:17 am
Has thanked: 8 times
Contact:

Re: Timer 1 for 12F675

Post by 1Handypal »

Hello all again,
Unfortunately this interrupt thing is not working right. I tried different ways and still could not get it to work correctly. It seems flaky/unstable/unpredictable.
I am tired of this meaningless battle over a simple matter, honestly. Simple things work, but as soon as you take it to a bit more complex - run into trouble.
Here is file attached.
Compiler returns multiple errors:
............\12F675_exp2.c(69): error: error in built-in assembly
............\12F675_exp2.c(70): error: error in built-in assembly
............\12F675_exp2.c(71): error: error in built-in assembly
.............\12F675_exp2.c(72): error: error in built-in assembly
.............\12F675_exp2.c(73): error: error in built-in assembly
12F675_exp2.c success

failure

Return code = 1
As soon as you comment all lines in C Code box - it all compiles successfully. I suspect something is loose within that FCD file...
Could somebody look into it? Thanks in advance.
Best.
Attachments
12F675_exp2.fcf
Created with Flowcode 4.3
(8.5 KiB) Downloaded 369 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Timer 1 for 12F675

Post by medelec35 »

Hi
Your getting errors because lines of assembly code your adding is in the wrong format.

For example you have got

Code: Select all

asm TRISIO 0x08;
Whereas is should be
asm
{

movlw 08h //Place 1000 into W
movwf _trisio //Move 1000 onto TRISA - set GP3 to i/p others to o/p

}

You can use:

Code: Select all

asm  movlw 08h 
asm movwf _trisio
But you will need precede with

Code: Select all

asm
on every line.
Normally with assembly and other compilers you will need to change to bank1 before writing to registers like _trisio
However with BoostC compiler, it's automatically done for you.
That's why I have left bank function off.

With assembly you need to move a literal value into working register (W).
Then move contents of W into Special Function Registors SFR.
You precede SFR with an underscore.

Not sure why you need to do this as with the last 12F675 I posted is allowing pic to work correctly.
If you don't think that's the case, then I can look into the issue.

Using Flowchart I have posted:
12F675GP3 port Test with GP1 WPU.fcf

If that works 100% of the time, which it does in my case, then I would be more inclined to look at the flowchart it'self

You need to bear in mind that Flowchart simulation is so much slower than hardware.

Therefore you may not always get the expected results.

Start simple to test functions first, then build up from that.

Martin
Martin

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Timer 1 for 12F675

Post by Steve »

Hello,

Because this is a V4 issue, I have moved the topic to the V4 forum.

Post Reply