diff --git a/source/position_sense/tamagawa/firmware/tamagawa_main.asm b/source/position_sense/tamagawa/firmware/tamagawa_main.asm index 8f6fc48..d77eb91 100644 --- a/source/position_sense/tamagawa/firmware/tamagawa_main.asm +++ b/source/position_sense/tamagawa/firmware/tamagawa_main.asm @@ -173,11 +173,13 @@ TAMAGAWA_SKIP_INIT_SUCCESS: ;Initialization successful status update ends here SBCO &R0.b0, PRUx_DMEM, TAMAGAWA_INTFC_CMD_STATUS_OFFSET, 1 -HANDLE_PERIODIC_TRIGGER_MODE: +CHECK_OPERATING_MODE: LBCO &R0.b0, PRUx_DMEM, TAMAGAWA_OPMODE_CONFIG_OFFSET, 1 ;If opmode=1, Host trigger is done ;If opmode=0, Periodic trigger is done QBNE HANDLE_HOST_TRIGGER_MODE, R0.b0, 0 + +HANDLE_PERIODIC_TRIGGER_MODE: ;Get compare event status LBCO &R0, ICSS_IEP, ICSS_IEP_CMP_STATUS_REG, 4 ; wait till IEP CMP3 event @@ -187,6 +189,7 @@ HANDLE_PERIODIC_TRIGGER_MODE: ; store compare event status SBCO &R0, ICSS_IEP, ICSS_IEP_CMP_STATUS_REG, 4 ; SET command TRIGGER + LDI R0.b0, 1 SBCO &R0.b0, PRUx_DMEM, TAMAGAWA_INTFC_CMD_TRIGGER_OFFSET, 1 HANDLE_HOST_TRIGGER_MODE: @@ -212,12 +215,15 @@ TAMAGAWA_HOST_CMD_END: ;check PRU host trigger for all three channels LBCO &R3.b0, PRUx_DMEM, TAMAGAWA_OPMODE_CONFIG_OFFSET, 1 ;skip interrupt to R5F in host trigger - QBNE SKIP_INTERRUPT_TRIGGER, R3.b0, 0 + QBNE SKIP_INTERRUPT_TRIGGER, R3.b0, 0 ;Generate interrupt to R5F - LDI R31.w0, 34;PRU_TRIGGER_HOST_TAMAGAWA_EVT0 ( pr0_pru_mst_intr[2]_intr_req ) -SKIP_INTERRUPT_TRIGGER: + LDI R31.w0, 34;PRU_TRIGGER_HOST_TAMAGAWA_EVT0 ( pr0_pru_mst_intr[2]_intr_req ) + ;Global reinit + set R31, TAMAGAWA_TX_GLOBAL_REINIT ;Handle next Postition in periodic trigger - QBEQ HANDLE_PERIODIC_TRIGGER_MODE, R3.b0, 0 + JMP HANDLE_PERIODIC_TRIGGER_MODE + +SKIP_INTERRUPT_TRIGGER: ;Handle next Position request by user. JMP HANDLE_HOST_TRIGGER_MODE diff --git a/source/position_sense/tamagawa/firmware/tamagawa_master_single_channel_bin.h b/source/position_sense/tamagawa/firmware/tamagawa_master_single_channel_bin.h index 0b79575..93ac76e 100644 --- a/source/position_sense/tamagawa/firmware/tamagawa_master_single_channel_bin.h +++ b/source/position_sense/tamagawa/firmware/tamagawa_master_single_channel_bin.h @@ -76,15 +76,16 @@ const unsigned int TamagawaFirmware[]= { 0x91401880, 0x914418c0, 0x91481801, -0x23019788, +0x23019988, 0x24000100, 0x81031800, 0x91001800, -0x69000006, +0x69000007, 0x91743a80, -0xcf03e0fd, +0xcf03e0ff, 0x1f03e0e0, 0x81743a80, +0x24000100, 0x81021800, 0x91021800, 0x570000ff, @@ -92,14 +93,15 @@ const unsigned int TamagawaFirmware[]= { 0x9105183b, 0x91081821, 0x91091806, -0x23002d88, +0x23002f88, 0x24000083, 0x81021803, 0x91001803, -0x69000302, +0x69000304, 0x2400229f, -0x570003ed, -0x21001f00, +0x1f13ffff, +0x21001a00, +0x21002000, 0xc9000702, 0x240000de, 0xc9010702, @@ -114,30 +116,30 @@ const unsigned int TamagawaFirmware[]= { 0x51047a1b, 0x101b1b1e, 0x103b3b1e, -0x230159c8, -0x21009500, +0x23015bc8, +0x21009700, 0xc9000705, 0x11035e1a, 0x69001a03, 0x2400881a, -0x21004c00, +0x21004e00, 0xc9010705, 0x11035e1a, 0x69011a03, 0x2400b01a, -0x21004c00, +0x21004e00, 0xc9020705, 0x11035e1a, 0x69021a03, 0x2400d81a, -0x21004c00, +0x21004e00, 0x901a3899, 0x1079791e, 0x1059591e, 0x1039391e, 0x1019191e, -0x230159c8, -0x21009500, +0x23015bc8, +0x21009700, 0xc900070c, 0x11035e1a, 0x69001a0a, @@ -149,7 +151,7 @@ const unsigned int TamagawaFirmware[]= { 0x1079791e, 0x1059591e, 0x1039391e, -0x21007700, +0x21007900, 0xc901070c, 0x11035e1a, 0x69011a0a, @@ -161,7 +163,7 @@ const unsigned int TamagawaFirmware[]= { 0x1079791e, 0x1059591e, 0x1039391e, -0x21007700, +0x21007900, 0xc902070c, 0x11035e1a, 0x69021a0a, @@ -173,8 +175,8 @@ const unsigned int TamagawaFirmware[]= { 0x1079791e, 0x1059591e, 0x1039391e, -0x21007700, -0x230159c8, +0x21007900, +0x23015bc8, 0x2eff819a, 0x100a0a5e, 0xc9000709, @@ -185,7 +187,7 @@ const unsigned int TamagawaFirmware[]= { 0x2400881a, 0x901a1819, 0x1019191e, -0x21009500, +0x21009700, 0xc9010709, 0x11035e1a, 0x69011a07, @@ -194,7 +196,7 @@ const unsigned int TamagawaFirmware[]= { 0x2400b01a, 0x901a1819, 0x1019191e, -0x21009500, +0x21009700, 0xc9020709, 0x11035e1a, 0x69021a07, @@ -203,7 +205,7 @@ const unsigned int TamagawaFirmware[]= { 0x2400d81a, 0x901a1819, 0x1019191e, -0x21009500, +0x21009700, 0x2eff9d8b, 0x2eff8183, 0x2eff8185, @@ -229,7 +231,7 @@ const unsigned int TamagawaFirmware[]= { 0x11017f1c, 0x6f011cff, 0xd104ff02, -0x2100b000, +0x2100b200, 0x1f070b0b, 0x101c1c7f, 0x100b0b0c, @@ -241,10 +243,10 @@ const unsigned int TamagawaFirmware[]= { 0x09010303, 0x09010b0b, 0x12630303, -0x2100c000, +0x2100c200, 0x24000023, 0x50030b02, -0x2100bf00, +0x2100c100, 0x24000123, 0x811838a3, 0x01012424, @@ -256,19 +258,19 @@ const unsigned int TamagawaFirmware[]= { 0x51082408, 0x510c240b, 0x5100060e, -0x2100a200, +0x2100a400, 0x10ececf0, 0x2eff818c, 0x5100440e, -0x2100c800, +0x2100ca00, 0x10ececf1, 0x2eff818c, 0x5100440a, -0x2100c800, +0x2100ca00, 0x10ececf2, 0x2eff818c, 0x51004406, -0x2100c800, +0x2100ca00, 0x24000044, 0x670424f3, 0x670824f6, @@ -291,7 +293,7 @@ const unsigned int TamagawaFirmware[]= { 0x11027f1c, 0x6f021cff, 0xd10cff02, -0x2100ee00, +0x2100f000, 0x1f070b0b, 0x101c1c7f, 0x100b0b0c, @@ -303,10 +305,10 @@ const unsigned int TamagawaFirmware[]= { 0x09010303, 0x09010b0b, 0x12630303, -0x2100fe00, +0x21010000, 0x24000023, 0x50030b02, -0x2100fd00, +0x2100ff00, 0x24000123, 0x812838a3, 0x01012424, @@ -318,19 +320,19 @@ const unsigned int TamagawaFirmware[]= { 0x51082408, 0x510c240b, 0x5100060e, -0x2100e000, +0x2100e200, 0x10ececf0, 0x2eff818c, 0x5100440e, -0x21010600, +0x21010800, 0x10ececf1, 0x2eff818c, 0x5100440a, -0x21010600, +0x21010800, 0x10ececf2, 0x2eff818c, 0x51004406, -0x21010600, +0x21010800, 0x24000044, 0x670424f3, 0x670824f6, @@ -353,7 +355,7 @@ const unsigned int TamagawaFirmware[]= { 0x11047f1c, 0x6f041cff, 0xd114ff02, -0x21012c00, +0x21012e00, 0x1f070b0b, 0x101c1c7f, 0x100b0b0c, @@ -365,10 +367,10 @@ const unsigned int TamagawaFirmware[]= { 0x09010303, 0x09010b0b, 0x12630303, -0x21013c00, +0x21013e00, 0x24000023, 0x50030b02, -0x21013b00, +0x21013d00, 0x24000123, 0x813838a3, 0x01012424, @@ -380,19 +382,19 @@ const unsigned int TamagawaFirmware[]= { 0x51082408, 0x510c240b, 0x5100060e, -0x21011e00, +0x21012000, 0x10ececf0, 0x2eff818c, 0x5100440e, -0x21014400, +0x21014600, 0x10ececf1, 0x2eff818c, 0x5100440a, -0x21014400, +0x21014600, 0x10ececf2, 0x2eff818c, 0x51004406, -0x21014400, +0x21014600, 0x24000044, 0x670424f3, 0x670824f6, @@ -409,9 +411,9 @@ const unsigned int TamagawaFirmware[]= { 0x51087a04, 0x51047a05, 0x13500202, -0x21016600, +0x21016800, 0x13f00202, -0x21016600, +0x21016800, 0x11000202, 0x2401099d, 0x809d0402, @@ -426,9 +428,9 @@ const unsigned int TamagawaFirmware[]= { 0x51087a04, 0x51047a05, 0x13500202, -0x21017700, +0x21017900, 0x13f00202, -0x21017700, +0x21017900, 0x11000202, 0x2401119d, 0x809d0402, @@ -443,9 +445,9 @@ const unsigned int TamagawaFirmware[]= { 0x51087a04, 0x51047a05, 0x13500202, -0x21018800, +0x21018a00, 0x13f00202, -0x21018800, +0x21018a00, 0x11000202, 0x2401199d, 0x809d0402,