Juan Lopes

Problem with sci (reception) MC908JL8CPE

Discussion created by Juan Lopes on Jun 2, 2011
Latest reply on Jun 8, 2011 by Jim Burdus

Hi, i need help with the sci, i can send and receive, but i can´t move the data received to the port B.
I try turn off the sci and then move to the port B and it works, but if not the port B show 09h (hexadecimal) (PTB1 = 1 ; PTB3 = 1).
Too i send a character when receipt and i receive 2 characters.
The connection is between the PC and uC, and use the Termite 2.6 for read the characters that sends the uC

I´m using the MC908JL8CPE , sorry for my english, and thanks for everything biggrin.gif

Here attached my code:


      mov          #$01,config1         ;Disable WatchDog        
      mov      #$00,config2      
          mov          #$FF,DDRB                       
      mov      #$40,DDRD          
          clr            PORTB              
      clr              PORTD
      mov      #$03,VAR
;***** SCBR: SCP1=0,SCP0=0,SCR2=0,SCR1=1,SCR0=0 *******
      mov      #$02,SCBR            ;Baud Rate register = 9600
;***** SCC1: LOOPS=0,ENSCI=1,TXINV=0,M=0,WAKE=0,ILTY=0,PEN=0,PTY=0 *******
      mov      #$40,SCC1             ;Control register 1
;***** SCC2: SCTIE=0,TCIE=0,SCRIE=0,ILIE=0,TE=1,RE=1,RWU=0,SBK=0 *******    
      mov      #$0C,SCC2              ;Control register 2 (TE,RE enable)
;***** SCC3: R8=0,T8=0,ORIE=0,NEIE=0,FEIE=0,PEIE=0 *******          
      mov      #$00,SCC3     ;Control register 3

      lda            SCS1    
      brclr      SCRF,SCS1,*
      mov      SCDR,VAR        
      mov      VAR,PORTB
      lda              SCS1
      mov      'R',SCDR
      brclr      SCTE,SCS1,*
      jmp      recepcion