What is the difference between:
1.
HIGH portx.n
pause 10
LOW portx.n
2.
portx.n = 1
pause 10
portx.n = 0
3.
PULSEOUT portx.n, 1000
???
Klaus
What is the difference between:
1.
HIGH portx.n
pause 10
LOW portx.n
2.
portx.n = 1
pause 10
portx.n = 0
3.
PULSEOUT portx.n, 1000
???
Klaus
The main difference will be the amount of code generated.
Due to my fear(or challenge depending) of bad code space usage, i'll use your example #2. Yeah in that case you must set the according TRIS register but... it's always a good practice to do it anyway![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks for the quick reply Steve.
When I tried it, I found that #3 used the least amount of code, but I'll go back and count those bytes again just to make sure.
Klaus
Can be right or wrong depending on how m,any time you use the Pulseout in the same code, do a simple copy/paste 2-3-4-5 times and compare all of your 3 method. I bet the second will take less codespace or really close to. Well just a bet. My brain-cells and fingers feel lazy now...
Last edited by mister_e; - 24th June 2005 at 05:25.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Finally had time to run some quick experiments.
Option #1 added 14 bytes
Option #2 added 10 bytes
and Option #3 added a healthy 100 bytes to my code.
Looks like you were right Steve, but I ran these at 1AM. Results at that time (for me at least) are probably as reliable as results after 3 or 4 beers.
BR
Klaus
good apertizerOriginally Posted by khoog
![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks