cancel
Showing results for 
Search instead for 
Did you mean: 

''short term'' upsd

april_t
Associate II
Posted on July 23, 2003 at 14:40

'short term' upsd

10 REPLIES 10
april_t
Associate II
Posted on May 17, 2011 at 11:55

1) The upsd run prgrams like port toggeling for 1 to 4 seconds then stop the prog and get lost.

2) The worm reset isn't work at all. only the POR reset work (mostly).

the program includes zeroing the IE.

why??????
joseph2399
Associate II
Posted on May 17, 2011 at 11:55

1. It sounds like maybe the Watch Dog Timer is doing this. Watch Dog Timer is enabled by default, you need to disable it if you are not going to service it.

2. How did you issue the Warm reset cmd? Are you using a DK3200 eval board or your own board.
april_t
Associate II
Posted on May 17, 2011 at 11:55

Thank you for your fast reply.

I don't think the problem caused by the Watch Dog because the first lines of code is kill the WD and all Interrupt sources.

The code itself is at the end of my reply.

The Hardware I use is my own design but it is designed based on the DK3200 methodes.

The code is work for 1 to 4 seconds and the cpu commitsuicide or do nothing with full speed !!!

best regards

room

omry rotem

The code :

void TestSerial (void) {

char c = 'U';

SCON |= 0x02; // set TI in scon

while (1) {

if (SCON & 0x01) { // If RI in SCON

c = SBUF; // Get the char

SCON &= 0x0FE; // Clear RI in SCON

}

SCON &= 0xFD; // Clear TI in SCON

SBUF = c; // Xmit the Char

while ((SCON & 0x02) == 0); // Wait Loop till finished xmit of last char

WDRST = 0;

P3_2 = ~P3_2 ;

P3_3 = ~P3_2 ;

}

}

void main (void) {

unsigned int timer2_baud;

IE = 0;

IEA = 0;

EA = 0;

WDKEY = 0x55;

WDKEY = 0x55;

PWMCON = 0;

S1CON &= ~0x40;

S2CON &= ~0x40;

UADR &= ~0x80;

PSD8xx_reg.PMMR0.byte &= ~2; //.APD_ENABLE = 1;

PCON &= ~0x20;

T2CON = 0x34; // Use Timer 2 as baudrate generator

// This sets Uart1 to use timer2 baud rate

PCON |= 0x0C; // Set UART2 to user timer2 baud rate

timer2_baud = (65536L - ( (FREQ_OSC * 125L) / (4L * 19200L)));

RCAP2L = (timer2_baud & 0x00FF);

RCAP2H = (timer2_baud >>

;

SCON = 0x50; // enable first serial UART & receiver

SCON2 = 0x50; // enable 2nd uart

// EA = 1; // Enable global interrupt flag

TestSerial (); // uncomment this function to verify serial communication

joseph2399
Associate II
Posted on May 17, 2011 at 11:55

Have you tried to load your code to a DK3200 eval board and see it works?

Alternatively, you can also try the demo code (dk3200_1) on your hardware and just to see if it is the code problem or the hardware problem.
april_t
Associate II
Posted on May 17, 2011 at 11:55

Thank you for the fast replay.

Yes, i tried to make some experimnets with the DK-3200 kit.

1) I cancel the Watch Dog closing sequence, and the Watch Dog is functional there.

2) with my board the same experiment coused the Watch Dog to work only once, then it need POR reset to start work make one Watch Dog reset and after a while disapear somewhere.

3) I make PD1 leg reflect the inside reset of the upsd.

with the DK-3200 each reset is recieved imediatly.

with my board the reset in pin is not cause the upsd to go to reset.

What can make such behavior of the reset pin ?

How can i know by SW if reset is POR reset or WD reset or other supervisor reset ?

please help me to solve the problem ASAP this is 10K pcs client

and he is very mad about not having his project in time....

best regards

omry rotem

joseph2399
Associate II
Posted on May 17, 2011 at 11:55

1. You should disable the Watch Dog Timer (WDKEY=0x55), if you do not have ISR written to service it.

2. When you disable the Watch Dog, you should not see any reset from it.

3. Please refer to Figure 20 on page 49, other sources of Reset can be from Low Voltage Reset (LVR), USB, or an External Reset. If your supply voltage is above the LVR reset threshold, 4 +/-.25V for the 5V part and 2.5 +/-.2V for the 3.3V part, then your reset is not from LVR. Please see page 50 of the data sheet for description on the USB and External resets.

april_t
Associate II
Posted on May 17, 2011 at 11:55

Please Advise:

how can I know the reset source, is it WD or LVR or POR reset ?

best regards.
joseph2399
Associate II
Posted on May 17, 2011 at 11:55

You can disable the Watch Dog and LVR at power up, then you can re- enable them one at a time to find out which one. LVR can be disabled via the LVREN bit in the PCON Register. The WD can be disabled by writting 0x55 to the WDKEY register.

april_t
Associate II
Posted on May 17, 2011 at 11:55

1. I know it is posible to disable each ''reset'' type seperatly.

2. The question is: AFTER I enable LVR and WD resets, WHEN I have a reset event, how can i find out which source was it.

3. Each reset deserve different action to be taken.

4. Is it true the uPSD canot distinguish the source ?

best regards

omry rotem