Hello,
I have a problem with the printf fonction.
I'm sorry for my bad english
My program is :
#include <hidef.h>
#include "derivative"
#include <stdio.h>
#include <termio.h>
int x=0;
int main(void)
{
{
if(x<20)
{
printf("%d\n",x);
x++;
return 0;
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////
On HyperTerminal, I don't receive the printf.
I believe that my program is in the loop "while (!(SCI.SCxSR1 & 0x80) ) {};" in the termio.c. WHY ???
By default, what is the port used, SCI0 or SCI1 ?
How do I configure the connection in hyperterminal, knowing that I have a MC9S12DG128 ?
Best Regards
Julien
已解决! 转到解答。
The termio.c contains a routine TERMIO_Init for the setup, it might need to be adapted for the hardware.
Alternatively Processor Expert (or Device Initialization) can be used to setup the sci module.
Daniel
I don't see any harware initialization: somewhere in your code should be a line like:
Initialize_SCI();
.. or something similar, possibly including a baud-rate setting, parity-type, etc
Look into demo code for your CPU
The termio.c contains a routine TERMIO_Init for the setup, it might need to be adapted for the hardware.
Alternatively Processor Expert (or Device Initialization) can be used to setup the sci module.
Daniel