Hello to all!
I made some tests with PIC16F887, to get some delays that I need for a code..I make a simple code to check the duration accuracy of delays...I note that for a delay 80μs at FC7 code the scope shows 100μs and for delay 5μs the scope shows 20μs....Is there something wrong with FC7 code configuration, or something else? ...at hardware there are a crystal 20.000 MHz , 2X22pF for crystal, and a led to check the code run...the test code run well, but the delay timing is wrong..I send you the test code for any idea about to how to have the correct timing...thanks.
PIC16F887 DELAY TIME
Moderator: Benj
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
PIC16F887 DELAY TIME
- Attachments
-
- DEMO-04-PIC16F887.fcfx
- (7.07 KiB) Downloaded 249 times
-
- 20180927_154718.jpg (133.77 KiB) Viewed 5683 times
-
- 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: PIC16F887 DELAY TIME
Software delays won't be very accurate but should not be too far of the mark.
I Could be wrong but I Believe it's down to microchip's free compiler bloating the code to make the professional version look like its worth more than it is.
As we are only talking microseconds, the bloating should not make any difference to the working of hardware if microsecond delays are not required.
It's more normal to use millisecond delays.
I don't believe it's an issue with Flowcode?
Maybe C code for the delay can improve things?
I Could be wrong but I Believe it's down to microchip's free compiler bloating the code to make the professional version look like its worth more than it is.
As we are only talking microseconds, the bloating should not make any difference to the working of hardware if microsecond delays are not required.
It's more normal to use millisecond delays.
I don't believe it's an issue with Flowcode?
Maybe C code for the delay can improve things?
Martin
- 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: PIC16F887 DELAY TIME
Hello,
I agree with Martin, If you try the free 60-day trial of the XC8 pro compiler then you see the difference it makes especially with microsecond delays. The free XC8 is not bad at all for most users but is artificially bloated if you need very precise timings.
I agree with Martin, If you try the free 60-day trial of the XC8 pro compiler then you see the difference it makes especially with microsecond delays. The free XC8 is not bad at all for most users but is artificially bloated if you need very precise timings.
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: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC16F887 DELAY TIME
many thanks medelec35 and Benj for info...I use Microchip PICkit-2 to load the code to pic mcu, so I import .EXE to that programmer.Until now I have not problems for delay timing..I need relative accurate delays in the area 5-100μs. Is anything else that I can do to impove the accuracy? Instead of delays is it possible to use pulse? How can I have a pulse in that area with FC7? thanks.