Hi pgo!
I have a question about bdm Rx&Tx route. In your program you use something number such as (2,2,12) to calculate the which BDM freq this program can communicate with.For JB16 6*(11~14)/4 = 16.5~21
am I right? what the Number 12 will effect?(speed).
If want to change the Freq range , can I just add nop between driver Data to BDM and driver BDM to high.
my code:
asm
{
BDM_ENABLE_ASM_TX
//LDAA #bitCount
SEC
//ROL bitCount
ROLB
Loop:
BCS IsOne //[3],bra 3c,not bra 1C,so add nop nop
NOP
NOP
IsZero:
BCLR BDM_PORT_Tx, (1<<BDM_OUT_BIT) //[4] Driver BDM low
//---11
BCLR BDM_PORT_Tx, (1<<BDM_OUT_BIT) //[4] Driver Data(0) to BDM
//---4
BSET BDM_PORT_Tx, (1<<BDM_OUT_BIT) //[4] Driver BDM high
//---4
ASLB //[1]
BEQ Done //[3]
NOP
NOP
BCC IsZero //[3]
NOP
NOP
IsOne:
BCLR BDM_PORT_Tx, (1<<BDM_OUT_BIT) //[4]
//---11
BSET BDM_PORT_Tx, (1<<BDM_OUT_BIT) //[4]
//---4
BSET BDM_PORT_Tx, (1<<BDM_OUT_BIT) //[4]
//---4
ASLB //[1]
BNE Loop //[3]
NOP
NOP
Done:
BDM_3STATE_ASM_TX //[4]
}
I use UF32 bus Freq is 30MHz,so the BDM Freq is 41.25~52.5MHz,am I right. Can I just add nop?
Thanks for your help.