| Electronics > Beginners |
| Assembly code Help! PIC16F57 |
| << < (12/32) > >> |
| KL27x:
So the most important thing for me to know at this point is what if any of these issues are present in the original source code you provided vs the updated version. The fact the creator didn't find the production version of the code and gave you this one makes me wonder if some/all of these problems might be due to this version of code he gave to you. Did you test the code you originally uploaded in the same way? Here is my guess where the issues originate at this point, but your clarification on testing of the original code would be immensely helpful. 1. problems in original code 59% 2. problems in intended changes 1% ; highly confident 3. problems in my execution of intended changes 30% ; you never really know when coding in assembly 4. register 0E and 0F perhaps utilized by the code 10% ; this is a bit weird if these problems are exactly the same when you tried both registers. If you can verify that the code as you uploaded it to me is not producing any of these problems, I am still curious to see this a bit further. |
| Electrofinn:
so just to clarify I am testing the completely untouched version straight from owner. will report back. |
| Electrofinn:
ok just noticed something that may or may not have affected testing. just flashed device and its like it didn't take completely, first its like there was no change from last flashed code, then did it again and light show didn't show up and then decided to erase and blank check device and i then re-flashed and now I am back to original untouched code, as intended. up until now I had just been clicking program device without erasing, I forgot that mplab v8 doesn't erase device before re-program or does it? |
| Electrofinn:
Well it looks like this falls within your 59% or should that of been 69%..anyway it gave me 2 instances of an incorrect win light show. you were absolutely on the right track, good call, I just never noticed it before, just the obvious things. |
| KL27x:
;D ;D ;D ;D I'm sorry, but I'm so so happy to hear this. I have learned quite a bit, though. And if you ever do manage to figure out the general location or memory or something more specific about the issues, try and reach back. It's just quite hard for me to debug without the hardware in front of me. I have learned (or relearned) a bunch of things though. It would appear that baseline takes 3 instructions to do a long call and 2 for a pagesel. Midrange, indeed, is just 2 and 1. This is actually a much bigger limitation than the half page thing, IMO. This could take up more than half the code space of the program loop. To get around the half page, all you should need to do is put your "Subroutine" as one instruction that is "goto subroutine.1" which is located in the upper half of the same page. :) My partially modified source code page attached. I cleaned out the program loop to make it more legible. And moved the initialization to page 3. And if it works, that would be nice to know. But you might want to check out the main program loop and see how it looks now. When I have trouble locating a bug in my own code, part of the "healing process" is to reformat/tab and generally clean things up. OP you might learn enough to actually fix this... esp with some help. And just see what works and what doesn't. You perhaps have to be a bit of a masochist, though. There's a lot of failure involved in assembly programming, esp when it gets overcomplicated or it's someone else's mess. *You might also try adding some bitmasks before those addwf PCL instructions. Those are a bit of a problematic thing. We added one to ... feature1, I think it was? You might try doing something that with all of the addwf PCL lookup table subroutines. This is a good idea in general when using that instruction. |
| Navigation |
| Message Index |
| Next page |
| Previous page |