Javier Asti

SCI problem with DEMO9S08DZ60

Discussion created by Javier Asti on Sep 10, 2008
Latest reply on Dec 28, 2012 by kook

Hi,
I am working with DEMO9S08DZ60 and I the first thing I want to test is the SCI ports. But I don't know why I don't transmit anything either in port1 or port2. (I use the oscilloscope trying to see the output signal).
My easy code is below, hope you can help me a little bit with this. Thanks in advance.

#include <hidef.h>
#include "MC9S08DZ60.H"

void main( void )
{
  UINT8 data[9];

  /* disable COP */
  SOPT1 = 0x20;     /* disable COP, enable stop mode */

  /* Init Clock, Use PLL Engaged External mode, from 8MHz crystal -> 16 MHz bus */ 

  MCGC2 = 0x36;
  while (!MCGSC_OSCINIT);

  MCGC1 = 0xB8;
  while (!MCGSC_IREFST);      
  while(MCGSC_CLKST != 2);
 
  MCGC1 = 0x90;
  MCGC3 = 0x44;
  while(!MCGSC_PLLST);

  while (!MCGSC_LOCK);

  MCGC1 = 0x10;
  while(MCGSC_CLKST != 3);
 
  MCGC2_BDIV = 0;
  
  /* Enable interrupt */
  EnableInterrupts;       

    SCI2C1  = 0x40; 
    SCI2C2  = 0x0E;
    SCI2BDH = 0x00;
    SCI2BDL = 0x41;
    SCI2S2  = 0x00;
    SCI2C3  = 0x00; 

    SCI1C1  = 0x40; 
    SCI1C2  = 0x0E;
    SCI1BDH = 0x00;
    SCI1BDL = 0x41;
    SCI1S2  = 0x00;
    SCI1C3  = 0x00; 

  while(1)
    {
    SCI2D = 'U';
    SCI1D = 'U';
    }
}       /* main */

Outcomes