cancel
Showing results for 
Search instead for 
Did you mean: 

Programming PSD

danes
Associate II
Posted on April 19, 2007 at 07:38

Programming PSD

4 REPLIES 4
danes
Associate II
Posted on May 17, 2011 at 11:51

I am at my wits end trying to make my code work. I have a uPSD3333DV on a designed board, but am also trying the code on a DK3300-ELCD. I am writing C with RIDE. I am able to JTAG both. I have simplifed my code to the following:

void main(void)

{

RCAP2H = 0xFF;//Sets baud rate at 115200

RCAP2L = 0xF5;//for both UART0 and UART1

T2CON = 0x34; // sets timer 2 for both R/T baud rates

SCON0 = 0x74;

while(1)

{

SBUF0 = 'H';

msDelay(10);

}

}

I have a subroutine for the msDelay function, but cannot even get either processor to send out a ''Hello World'' from the serial port...

The CAPs and PSDsofware Express are extremely confusing... I would imagine my code is so basic that this must be a CAP configuration issue...

HELP!!!

danes
Associate II
Posted on May 17, 2011 at 11:51

I added the following:

P3SFS = 0x03;//Enable UART on Port 3

PS0 = 0;//Set UART0 for Priority status

PCON |= 0x80;

This at least made the serial port do something (an endless string of '6's).

danes
Associate II
Posted on May 17, 2011 at 11:51

So making thoses changes at least made all the code work in the RIDE simulator. One odd thing... in the RIDE simulator UART1 is showing up for BAUD and everything for Timer 1 instead of Timer 2. It was my desire to use Timer 2 to generate the transmit and receive Baud rate for both UART0 and UART1. Anyone know how to configure this?

Gosh... feel like I am talking to myself alot - anyone reading these?

horst2
Associate II
Posted on May 17, 2011 at 11:51

Hello Sir,

I'm trying to get familiar with thy upsd 3334. On my way I succeed programming the uarts with differnt baudrates, by using the keil compiler.

When you need two differnt baudrates, it is necessary to use timer 2 for uart 0 and timer 1 for uart 1. I know that it is possible to use one timer

if you want one baudrate for both uarts, but i've never test this possibility. Perhaps you can find a solution for your problem in my source.

regards

Horst