There seems to be a mistake, because the code did not work, and after my change, it did work.
bsf ADCON0,2 ;start conversion and wait for it to complete
goto $-2 is wrong, because it goes back 2 lines and starts the conversion all over again. You'll want to goto $-1 instead, to just test until the conversion is done.
However, I would reccommend this…Continue
Added by Ritchie Thai on February 19, 2011 at 7:21pm — No Comments
You know what I say to tables? Well, I don't say it, because I am not the type to publicly use such language, but once you get past the character limit it causes problems that can be tricky even if the solution is known.
Here's a work around that I'm using. "can" wasn't worth making a table for. A table would take 4 lines. If you include the code to…Continue
Added by Ritchie Thai on February 1, 2011 at 1:30am — No Comments
If there is a certain length of code coming before the DT (define table) directive, then characters/entries in the DT past a certain point will fail to return a value. Instead, upon reaching that character, the program will restart from the beginning.
Remember, or realize, that DT is actually a short form for a long list of retlw instructions. That means that having a DT holding a long string counts as many instructions.
This does NOT appear to be an issue of…Continue
In one of my define tables, if the table gets to a certain length I get a bug in my code. Just take one character away from that and everything is fine. I have found no significance in regard to... actually, I never counted it until now.
If there are 33 characters, my code bugs out. 32 is okay. Well, 32 is a very important number, but I have longer tables elsewhere. There is also no reason for this to bug out. It's simply absurd!
Each dt (define table) directive uses up a line for each character in your table/string. If you're not careful, your code could get long despite being short.
Here's how the define table directive works. Each character in your string is actually translated into a single retlw (return literal in W).
is translated into:retlw 'H'
Added by Ritchie Thai on January 26, 2011 at 12:00am — No Comments
If the path size of your MPLAB project's directory is too long, for example:
then a .hex file will not be created.
I am now using a workspace with the much shorter path:
Don't computers suck?