Problem with 9s08gt60 SCI output

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

Problem with 9s08gt60 SCI output

2,172 Views
grig
Contributor I
I am using a PAN802154 board for development. I used the BeeKit to generate the WirelessUART project for a . Built and downloaded fine, but it does not appear to put anything out on the SCI port. It should display a startup message. All the code appears to be setting up and accessing the SCI ports as I would expect. The external clock is at 16MHz, so the Bus clock should be 8MHz. The board is powered at 3.2v (enough to drive the SCI). The board shipped with a test program loaded and that wrote to the terminal emulator just fine (but I don't have the source for it). This should be writing at 38400 bps.

Okay, maybe I did something wrong, so I went back and created a generic project to just access the SCI. Using the Processor Expert (ugh!), I built a generic project to echo a character. It polls the SCI1D looking for a character and then writes it out when it sees it. Using the debugger, I know that I am getting the character in, but when I write the character out, nothing is displayed. This is writing at 9600 bps.

Any ideas?

Jeff
Labels (1)
0 Kudos
Reply
5 Replies

694 Views
Nabla69
Contributor V
Grig,
 
If there is activity on the TxD line, it means you have the wrong baudrate.
Check the PLL is not working and divers are proper values.
 
If there is no activity, check you have configured the module properly before putting values to send in the data register (like for instance, module being enabled).
 
Kind Regards,
Jeane.
0 Kudos
Reply

694 Views
grig
Contributor I
Thanks for the reply, Jeane. I am pretty sure that I am setting things up properly. There doesn't appear to be too much to this. It looks like there are just a couple of registers to set up (SCI1BDH, SCI1BDL, SCI1C2).

I threw together another, simple program to try to do this (see below). What I found was that I was receiving characters, but they were incorrect if I calculate the baud rate with an 8MHz bus clock (16MHz system clock). When I calculate with a 4MHz bus clock, the correct characters are received (when looking at them with the debugger). I know that I had read, someplace, that the bus clock was 1/2 the system clock, and that the PAN802154HAR was compatible with the SARD (with has an 8MHz bus clock). However, even though I can receive, I am still unable to transmit anything. It appears to write the data to the SCI1D register, but nothing is coming out on the terminal.

Baud Rate = 6 = 4000000/(38400 * 16)

I tried this at different BPS with the same results.

Thanks,
Jeff

Here is the entire test program that is just supposed to echo a character:

#include /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */



void
main(void)
{
volatile unsigned char tmp;

EnableInterrupts; /* enable interrupts */
/* include your code here */

SCI1BDH = 0;
SCI1BDL = 6; //38400 @ 4MHz bus clock
SCI1C1 = 0;
SCI1C2 = 0b00001100;

for(;:smileywink:
{
if (SCI1S1_RDRF)
{
tmp = SCI1D;
while(!SCI1S1_TC);
SCI1D = tmp;
}

__RESET_WATCHDOG(); /* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
} // end func--main()
0 Kudos
Reply

694 Views
bigmac
Specialist III
Hello Jeff,
 
You could try commenting out the line -
while(!SCI1S1_TC);
 
This actually shouldn't be necessary in this simple program, and it eliminates any risk of COP timeout occurring whilst waiting (although I'm not sure why the flag wouldn't already be set when first tested).
 
Regards,
Mac
 
0 Kudos
Reply

694 Views
Balk
Contributor II
Grig,
I've had very similar problems with the PAN802154HAR module, and the wirelessUART sample program that comes with the Beekit. The UART works for a few characters, then crashes and sends/displays erroneous data. I dont think there is an issue with baud rate - however i did read a post on this topic that suggested that an interrupt had to be disabled, before transmitting data (search for posts by 'giga'). I couldn't get this to work, however now that the new Beekit is available (with zigbee stack) I expect some more support from Panasonic.
There is also a specific port configuration file that panasonic has available, for use with the Beekit. You will have to email someone at Panasonic to get it, or maybe they will post it on their website.
0 Kudos
Reply

694 Views
Vncnt
Contributor I

would help me with example code for SCI?

0 Kudos
Reply