Ed Taylor

odd behavior PTB2/PTB3 on 908jk3

Discussion created by Ed Taylor on Oct 3, 2006
Latest reply on Oct 4, 2006 by Ed Taylor
hi:
 
this is driving me nuts! i had problems programming and attributed it to other changes i had made, not so! i have simplified the code and can create the problem on demand. the two lines below ;hardware init cause the programmer (usbmultilink) to do some unusual things. if i reverse the lines so that PTB3 is cleared before PTB2 is set everything works as expected. if i program the chip with the lines in te current order i get no error messages, however {F5} reports that the processor is running and the green led does not light. if i disconnect the multilink and run from a power supply the green led does not light either. swapping the two lines works great on either the in circuit debugger or the stand alone. has this been identified before?
 
main:
_Startup:  
        mov  #%00000001,CONFIG1  ;disable the cop
           rsp
;hardware init
           bset  2,PTB                 ;ensure red is off
           bclr  3,PTB                 ;start with a green light
           mov   #%11111111, DDRA      ;porta is not bonded set as outputs
           mov   #%00001100, DDRB      ;portb d7..d4 analog, d3=redled d2 grnled, d1,d0 mono8 interface
           mov   #%00110011, DDRD      ;portd d7,d6 undefined digital inputs, d5,d4 injector drv, d3,d2 analog current monitors d1,d0 unbonded
           bra   *
 
 
best regards,
 
ed

Outcomes