Need Help with bootloader for MC9S08GW64

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need Help with bootloader for MC9S08GW64

1,085 Views
Designer11
Contributor IV

Hi Everyone,

I'm looking for a bootloader for the 9S08GW series of microcontrollers. I tried to debug the GW bootloader that came with the AN2295SW and failed on that too.

pastedImage_1.png

After looking at the original flash.ini that came with with the S08GW bootloader folder. I noticed the chipmode = 9S08JM60. Shouldn't it be 9S08GW64  instead, since i'm working with the GW series ? 

Best Regards,

Vu

Tags (2)
0 Kudos
5 Replies

787 Views
Designer11
Contributor IV

Hi,

I believe i need to enable the clock gating for the 9S08GW64 SCI before any activity can take place. Since, i'm not familiar with assembly language. Can anyone show me the appropriate commands and where to insert the commands ? Attached is the bootloader source codes. I'm using Codewarrior 11.

Below is the disassembled C version of "enabled SCI 1 module clock and assigned pin B1 as TXD1 and pin B0 as RXD1"

;SCGC1_SCI1 = 0x01; //enable SCI1 module clock
LDHX #0x1808
LDA ,X
ORA #0x02
STA ,X

;PTBPF1_B1 = 0b010; //pin B1 as TXD1
LDHX #0x1944
LDA ,X
AND #0x8F
ORA #0x20
STA ,X
;PTBPF1_B0 = 0b010; //pin B0 as RXD1
LDA ,X
AND #0xF8
ORA #0x02
STA ,X

  

Thanks,

Vu

0 Kudos

787 Views
Designer11
Contributor IV

Any suggestions or ideas  guys ?

0 Kudos

787 Views
tonyp
Senior Contributor II

It's unclear what you're asking.

Do you want to know how to enable the SCI1 clock?

Hasn't the code you posted the answer?

(SCGC1_SCI1 = 0x01; //enable SCI1 module clock)

Actually, SCGC1_SCI1 is a bit, not a register and bit.  But I don't know CW, whether it 'magically' understands to which register the bit belongs based on this naming convention,

With the following definitions:

SCGC1               equ       $00001808           ;*** SCGC1 - System Clock Gating Control 1 Register; 0x00001808 ***
SCGC1_SCI1          equ       1                   ; SCI1 Clock Gate Control
mSCGC1_SCI1         equ       %00000010

you would need something like:

SCGC1 |= mSCGC1_SCI1;

in C, and something like:

lda SCGC1

ora #mSCGC1_SCI1

sta SCGC1

in assembly language.

This has to happen anytime before you write to any SCI1 registers (put simply, without clock to the relevant SCI module, don't expect writing to any SCI register to do anything.)

0 Kudos

787 Views
Designer11
Contributor IV

Hi Tony,

Thank you for the reply, Basically, i tried to use the GW bootloader ( see attached code above) for a project but,it failed to communicate with the Windows GUI app. So, I poked around the bootloader source codes but didn’t see ( My assembly coding is very limited)  the SCI clock initialization. I tried to come up with the SCI initialization code, which I posted above but the  bootloader still failed to communicate with the Windows GUI app.

0 Kudos

787 Views
Designer11
Contributor IV

So, after successfully porting the project into CodeWarrior 11, and got it to compile and enter debug mode. I decided to toggle pin  PTA5 but unable to see the pin transition from  low to high. 

BSET 5,1
BSET 5,0

Can anyone show me what am i doing wrong ? 

0 Kudos