Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: RX63N setting MPC

$
0
0
Greetings I am trying to implement the RSPI in RX63N. However it is not working, so far i have noticed that I am unable to set the MPC correctly (write protection is handled). Writing into MPC only sets every fourth register, here part of my code and the results: .h: #define MPC_PA4F        (*((volatile uint32_t *)        (0x0008C194)))  //Port A Pin 4 Function Register #define MPC_PA5F        (*((volatile uint32_t *)        (0x0008C195)))  //Port A Pin 5 Function Register #define MPC_PA6F        (*((volatile uint32_t *)        (0x0008C196)))  //Port A Pin 6 Function Register #define MPC_PA7F        (*((volatile uint32_t *)        (0x0008C197)))  //Port A Pin 7 Function Register .c:     MPC_WPR &= ~(1 7);   MPC_WPR |= (1 6);       MPC_PA4F |= (1 3 | 1 2 | 1 0);             //equals 0x0D   MPC_PA5F |= 0x0D;   MPC_PA6F |= 0x0D;   MPC_PA7F |= 0x0D;     MPC_WPR &= ~(1 6);   MPC_WPR |= (1 7); When checking the registers after the code being executed, 0x0008C194 to 0x0008C196 still have the value 0, while only 0x0008C197 has the value 0x0D. It should be noted though, that 0x0008C197 is already being set to 0x0D when writing this value to 0x0008C194. Same goes for setting every other of these registers independently. Only when setting 0x0008C193 (not used here), it writes to 0x0008C193, writing to 0x0008C190 - 0x0008C193 sets only register 0x0008C193 again though. I also checked the disassembly, it displays the correct addresses:   --MPC_PA4F |= (1 3 | 1 2 | 1 0);             //writes into xx197...(instead of xx194)  FFF00427   FB 1E 94 C1    MOV        #0x08C194:24,R1             08  FFF0042C   EC 12          MOV.L      [R1],R2  FFF0042E   65 D2          OR         #0x0D:4,R2  FFF00430   FB 1E 94 C1    MOV        #0x08C194:24,R1             08  FFF00435   E3 12          MOV.L      R2,[R1]   --MPC_PA5F |= 0x0D;  FFF00437   FB 1E 95 C1    MOV        #0x08C195:24,R1             08  FFF0043C   EC 12          MOV.L      [R1],R2  FFF0043E   65 D2          OR         #0x0D:4,R2  FFF00440   FB 1E 95 C1    MOV        #0x08C195:24,R1             08  FFF00445   E3 12          MOV.L      R2,[R1] Status of the registers after writing:  0008C194   00             BRK  0008C195   00             BRK  0008C196   00             BRK  0008C197   0D             BRA.S      0x8C19C I hope someone can tell me what I am doing wrong here. Thank you in advance. EDIT: It seems I accidentally posted this to "Bluetooth". I am sorry about this mistake, but I dont see an option available to erase/move this post.

Viewing all articles
Browse latest Browse all 59170

Trending Articles