dance-or-die Posted January 2, 2010 Report Share Posted January 2, 2010 Hello, How can I change the LSB / MSB order of DOUT Modules in mios_srio.inc chris Quote Link to comment Share on other sites More sharing options...
TK. Posted January 2, 2010 Report Share Posted January 2, 2010 Here the required modification: MIOS_SRIO_Loop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 7 bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 7 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 7 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 6 bcf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 6 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 6 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 5 bcf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 5 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 5 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 4 bcf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 4 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 4 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 3 bcf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 3 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 3 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 2 bcf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 2 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 2 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 1 bcf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 1 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 1 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop btfsc MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bsf IRQ_TMP5, 0 bcf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK bsf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss INDF2, 0 bcf MIOS_SRIO_LAT_DOUT, MIOS_SRIO_PIN_DOUT btfss MIOS_SRIO_PORT_DIN, MIOS_SRIO_PIN_DIN bcf IRQ_TMP5, 0 bsf MIOS_SRIO_LAT_SCLK, MIOS_SRIO_PIN_SCLK nop [/code] and attached a precompiled .hex file Best Regards, Thorsten.mios_p18f452.hex Quote Link to comment Share on other sites More sharing options...
dance-or-die Posted January 2, 2010 Author Report Share Posted January 2, 2010 Sorry, I tried that yesterday without success, but I am not sure. I test it with dout_buttons_v1c application and the result is the same as with unmodified mios_srio.inc SR# 1 Pin#0 0x00 let lit a LED on physical Pin 7 (QH) on a 74HC595 ... SR# 1 Pin#7 0x07 let lit a LED on physical Pin 15 (QA) on a 74HC595 that are the right results for standard mios_srio.inc I guess. but I get this for both cases modified and unmodified. I have also tried to change the DIN bit order with same effect. It seems that nothing changes. What about the applications, are there any changes to make? chris Quote Link to comment Share on other sites More sharing options...
TK. Posted January 2, 2010 Report Share Posted January 2, 2010 I tried that yesterday without success, but I am not sure. So, you compiled MIOS by yourself and uploaded it to your core before uploading the application? If this modification hasn't caused an effect, then I assume an handling error (please describe more exactly what you did to clarify the issue). Since I assume an handling error, I attached a precompiled .hex file so that you can easily compare the results. Before continuing with speculations, could you please give me some feedback if the .hex file I gave you is working at your side. There are no other changes which are required, it's really straightforward. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
dance-or-die Posted January 2, 2010 Author Report Share Posted January 2, 2010 Yeah, I wondered by myself but the precompiled Mios Version do the same. I have also think about a upload failure, but the precompiled Version shows no longer the "READY." Message first. And so I think all is gone right by uploading. I will now have a try with Linux and MIOS Studio 9 to upload, because I can't use the core feedback feature with my old Win 98 :D and Studio 7.5 Later more ... Chris Quote Link to comment Share on other sites More sharing options...
dance-or-die Posted January 2, 2010 Author Report Share Posted January 2, 2010 I will now have a try with Linux and MIOS Studio 9 to upload, because I can't use the core feedback feature with my old Win 98 :D and Studio 7.5 Later more ... Shit I can't believe that. I'm so sorry Yes it works, now. MIOS wasn't uploaded right to the core, I don't know why. Most changes (try to learn assembler the last days :D) on MIOS or MB64 takes a small effect and I thought the code was proper uploaded to the core. Thanks for the help Thorsten and best wishes for the coming decade. Chris Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.