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.
Timer 1 for 12F675
Moderator: Benj
Re: Timer 1 for 12F675
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.
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 409 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Timer 1 for 12F675
Hi
Your getting errors because lines of assembly code your adding is in the wrong format.
For example you have got
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:
But you will need precede with 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
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;
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
Code: Select all
asm
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