Search results

  1. chopnhack

    Converting Switch/Case statement in C to ASM?

    When I first started with MPLABs I had read absolute code was obsolete. They recommended (as did some web videos) the use of relocatable code. I think the thought behind it was that with modern computers it was more efficient and it made the code itself more portable? Why are you recommending...
  2. chopnhack

    I need to hire someone for a logic design

    I missed this post when it first came around and I find it fascinating :) Somehow I knew that you would say PIC after I got through the first few posts! My cup currently runneth over and spills all over my skill, LOL - otherwise I would love to lend a hand. I don't think you should give up on...
  3. chopnhack

    Converting Switch/Case statement in C to ASM?

    I don't and that is making it much harder for me to work with these... I do understand that instructions and data run on two different buses. I am treating what I do not understand as a black box until I can fill in the gaps with experience or trial and error. The datasheet is expecting the user...
  4. chopnhack

    Converting Switch/Case statement in C to ASM?

    Yes, its an extra step, but not too bad once you 'think' like the assembler does. No movff available in this series. Were you able to understand what those folks were referring to in the link above?
  5. chopnhack

    Converting Switch/Case statement in C to ASM?

    It is a function and it does get called, maybe that is what the chaps at the other forum were referring to! I really did not understand what they were getting at: http://www.microchip.com/forums/FindPost/918642 . I disagree. That is what the line of code ahead of the movwf was for, to move the...
  6. chopnhack

    Converting Switch/Case statement in C to ASM?

    Actually it was the second line of each function: slow, standard and fast that was causing the fault. It was resetting the TMR0 value to zero thus causing the low randomness. movlw .1;.175 movwf Delay100ms <----------------
  7. chopnhack

    Converting Switch/Case statement in C to ASM?

    Offensive code on its way ;-) ;******************************************************************************* ; * ; Filename: * ; Date:02/23/2016 * ; FileVersion:0.6 * ; Author: * ; Company: * ; Description:Simple prog. to blink one port using ASM and repeated code * ; *...
  8. chopnhack

    Converting Switch/Case statement in C to ASM?

    Ok, the successful resolution of the issue has been attained thanks to the good folks over at microchip forums and you guys of course! The problem was fixed by removing the lines of code in each function that were passing the literal to the function Delay100ms. Apparently W was being passed...
  9. chopnhack

    Converting Switch/Case statement in C to ASM?

    Yes, thank you Harald - I have the file written that way too, but for testing I moved the tmr outside of the loop to isolate it for debugging.
  10. chopnhack

    Converting Switch/Case statement in C to ASM?

    Apparently TMR0 was functioning correctly. My code was overwriting TMR0's value. I am waiting for a better explanation of what is going wrong and how I can avoid it. There is a difference between code and data spaces on the pic and apparently I was addressing one variable expecting the literal...
  11. chopnhack

    Converting Switch/Case statement in C to ASM?

    I am working on TMR0's function and how it is implemented on this chip. I posted in Microchip's forum seeking assistance on how to properly setup the SFR's for this feature. The TMR0 in simulation and in circuit live is not acting as a timer. We should see the TMR0 register value change and...
  12. chopnhack

    Converting Switch/Case statement in C to ASM?

    Oh boy :oops: - I just verified that... I did not use enough examples to verify my previous observation, my apologies! I was reading the datasheet and remembered seeing that the AND performed a boolean function, but it was the ANDWF not the ANDLW and that certainly makes a difference. I seeded...
  13. chopnhack

    Converting Switch/Case statement in C to ASM?

    Yes, I am understanding now that it is operating as a boolean evaluation, but I was expecting a modulo function! The above is why I thought that. The current code checks for 0,1,2,3 however the frequency of those numbers appearing is going to be very low since we are starting with an 8 bit...
  14. chopnhack

    Converting Switch/Case statement in C to ASM?

    Not all Harald, you have been a huge help and suggested an excellent solution, I have just failed to implement it properly or have made some other novice mistake. Your help is much appreciated and thank you! Hi Adam, yes, thanks for the clarification of btfsc - I wasn't sure at first, but I...
  15. chopnhack

    Converting Switch/Case statement in C to ASM?

    It's the second line in loop under Main's LOOP. I also found a RNG, but that is not working either. What do the operands do with BTFSC RANDOM,4? I thought that it would shift RANDOM by 4 places? When I simulate the lines that have BTFSC, they do nothing to the RANDOM register. (Edit - I will...
  16. chopnhack

    Converting Switch/Case statement in C to ASM?

    I have no issues with a extra case, i simply looped it back into the program. The trouble I have in simulation is the ANDLW is not generating a 0-3 value.
  17. chopnhack

    Converting Switch/Case statement in C to ASM?

    I don't see why it would not have accepted it - the 'three' was a constant holding a literal value of 3 - when it was used in ANDWF three - the literal value of 3 was AND'd with the working register's value. Problem is though, I think the assembler/linker is doing a strict boolean comparison...
  18. chopnhack

    Converting Switch/Case statement in C to ASM?

    I will give that a try - the 'three' was a constant assigned value decimal three, shouldnt that have worked?
  19. chopnhack

    Converting Switch/Case statement in C to ASM?

    Indeed, no easy way to check the register in real time! It requires another piece of equipment at $50. I rewrote the code to make use of a small RNG. The problem I am having with it as I watch it in simulation is that the working register is passed a number (decimal 10) by the time it gets to...
  20. chopnhack

    Converting Switch/Case statement in C to ASM?

    I believe I have made some progress gents: ;******************************************************************************* ; * ; Filename: * ; Date: 02/23/2016 * ; File Version: 0.6 * ; Author: * ; Company: * ; Description: Simple prog. to blink one port using ASM and repeated...
Top