Hi Robert,
The global address bits [22:16] are used only when certain instructions are used – Sec. 3.3.2.3. So the address 0x7000 is from the unpaged linear space (Figure 3-17).
The Send_Command routine is eighter DC.B ….., or BSET…. - … RTS. That is only different write style. The BSET = 0x1C, then address 0x0106 and data 0x80, …
So if you use for example in RAM:
ORG $3000 ;position of the Send_Command routine
DC.B $1C, $01, $06, $80, $1F, $01, $06, $80, $FB, $3D
Or use this style:
ORG $3000 ;position of the Send_Command routine
BSET 0x0106, #128 ; CCIF = 1;
BRCLR 0x0106, #128, *+0 ; wait for CCIF = 1;
RTS
The result is the same.
The next thinks you need to take care of – in the debugger the memory window has to show different memory segment as used for FLASH manipulation. For example when the memory controller working on sector $7000 the memory window must show e.g. RAM window. The reason is that the BDM is trying to refresh data which is showed in debugger and it could influence the memory controller action. So the best way is to set the breakpoint after RTS instruction executed from RAM. Then change the address in debugger memory window to $7000 and see the result.
Please check if the “refresh….” Is selected in: HC12MultilinkCyclonePro/Debugging Memory Map/ - select global /Modify/Details / -> refresh memory when halting.
This must be enabled if you want to see actual data in debugger memory window.
Best Regards,
Stano.