MC9S08QE128 problem with Serial Communication

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

MC9S08QE128 problem with Serial Communication

1,721 Views
ShirleyGuan
Contributor I
Hi everyone, I seem to have problem with the Serial Communcation for my DEMOQE128 board with the 8 bit MCU.
My project has a count and I want to transfer that count to pc. What I received in Hyperterminal on XP and Putty on Vista is constant garbage. eg. spade shapes, chinese character, etc.
I went through all the trouble shooting such as changing cables, jumper settings, sci settings, and sci initalization. I think it has to do with the linker file.
Does anyone have a serial communication sample that works with the board so I can test out to see if my serial port actually work.
p.s just wondering if this board has a 8 MHz bus clock. Because i set the baudrate to SCI1BDL = 0xD0 to give me 2400bit/sec. If the bus clock is not 8MHz then I have to change my baudrate.
 
Thanks for reading.
 
_Shirley
Labels (1)
0 Kudos
6 Replies

402 Views
ShirleyGuan
Contributor I
Thanks so much JimDon for your help. I finally got my code working with PE.
 
 
_Shirley
0 Kudos

402 Views
JimDon
Senior Contributor III
Thanks for taking the time to figure it out.
You did a great job. Amazing what some sleep can do....
If you look at the terminal code, you can see it would be very easy to add you own commands.
This makes for a very handy way to test things while you are working.
If you keep your code in a common directory as I have done here, you can have two project using the same code. One to test with, one that is your real application.



Message Edited by JimDon on 2008-03-24 12:48 PM
0 Kudos

402 Views
ShirleyGuan
Contributor I
JimDon
 
I'm sorry, but can you walk me through your code. I ran your code and it didn't do anything on Putty. So which code do I need to make the serial com work. I just want to transfer a character to putty. Also if jumper j8 is not removed, the serial wont work right. Sorry if I sound like a newbie to this. Thanks for your help though.
 
 
 
_Shirley
0 Kudos

402 Views
ShirleyGuan
Contributor I
Yes I am using codewarrior to communicate with the board. I just the Demo lab code that was provided by freescale from the dvd I got. Yes 8MHz clock is better since it can work with my old codes. I am using USB to power up my board instead of batteries. Yes it would be nice if you can post a tutorial lab for me.
Thanks for help JimDon.
 
_Shirley
0 Kudos

402 Views
JimDon
Senior Contributor III
Ok here is a link to the code.
If you build and run it you should get a
*** Restart ***

Ready>


prompt at 2400 baud. If you type 'h' return it should print a little menu. As I mentioned this is a Processor Expert project, how ever if you do not wish to use PE you can turn it off, or cut and paste code you need in to your project. Do this first just to make sure it all works.

There is a file in the FlashSources direction called SerialPort.c that has a little command driver.
The code for the serial port is int AS1.C and there is full documentation about the API.
My code is not that well explained, as it was just for me so if you have and questions, ask.
Also if have not done so already, jumpers need to be moved on the DEMOQE board before the serial port will work.

J8 - the jumber should be removed
J7 - Should be on TxD
J6 - Should be on RxD






Message Edited by JimDon on 2008-03-24 01:33 AM
0 Kudos

402 Views
JimDon
Senior Contributor III
Are you using codewarrior? If so I will post a link  to a project for the QE that talks to the serial port.
Generally, you need to set up the clocks.

Do you want to run at 8 Mhz? The project as it is sets the clock to 24Mhz, but since it is a Processor Expert (PE) project, I chould easily change it to 8 Mhz (PE will automaticlly recalculate the baud rates, so it is no problem). Unless you need to run on batteries, 24Mhz is the max and a good choice.


0 Kudos