MC56F8013 - SCI Problem

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

MC56F8013 - SCI Problem

1,872 Views
t_
Contributor I
Hi people!
I'm newbie in develop with MC56F8013 and I've had some problems in trying a serial communication between my microcontroller and a pc.
What I need is send an information through the RS-232 from pc to MC56F8013, but I'm not getting it.
I've already tried to make that using SPI and SCI, but I don't think that I'm making in a correct way...
I have many doubts about how to connect SCI or SPI with the RS-232 connector in the board. Is it already connected with the SCI and SPI service, or Do I have to set something to link that with those services?
This is my current code, where I tried to make a interruption when I try to receive something in RS-232 of the board:
Code:
#include <stdio.h> #include "MC56F801x.h" #include "isr.h"void initIsr () { asm (bfclr #$0300,sr);           /* allow lowest priority *//* SCI */     asm(bfset #$C000,X:IPR2);   /* Setting Interrupt register to priority 2 */   
 asm(move.w #$00D0,X:SCI0_BR);  /* Setting Baud Rate register to value 208 (9600) */   
 asm(bfset #$1234,X:SCI0_CR);  /* Setting Control register (0001001000110100) */ asm(bfclr #$FFFF,X:SCI0_SR);  /* Setting register to Baud Rate
  be controled only by the Baud Rate register */  
}#pragma interruptvoid iserial () {  printf("Test"); }

In the Interrupt Vector:
jsr >Fiserial        ; SCI Receiver Error
jsr >Fiserial        ; SCI Receiver Full 
So, when I try to send something by HyperTerminal, only to test, my code should go to the function iserial, is not it?
Plz, What Am I doing of wrong? Is it missing to set something??? How could I test if my interruption is working well???
Tks a lot!!!! ^_^

Alban Edit: FSL Part Number in Subject line + split/moved to appropriate location.

Message Edited by Alban on 2007-03-14 02:56 PM

Labels (1)
Tags (2)
0 Kudos
1 Reply

590 Views
jag
Contributor IV
Hi, 3 things:

1 - why don't you use something like QuickStart or Processor Expert to configure the 8013? It's much more easy that doing it by asm()? :smileyhappy:

2 - I'm not sure that printf() works like you think. printf() is set to put char where? on the serial line? If so have you configured the SCI to send datas?

3 - The easiest way to se if the interrupt works is to attach a Led to a GPIO pin and toggle it when the interrupt arrives.

Bye Jack
0 Kudos