| Author | beginning argument ( Replies received: 5 ) |
| Spkt |
Posted 01-05-2006 at 23:06   |

Registered on : 04-23-2006
From 0
Messages : 9
OFF-Line
|
Hi all,
I coded a program for st52f513, which takes inputs from ADC0 and ADC1, finds the error which is the difference, and produces a PWM signal accordingly. When I debug the program on the programmer board, I see that ADC0 and ADC1 are read properly, and there is a PWM output on the timer0 pin which changes as I play with ADC0 and ADC1 inputs.
However, as I take the chip off the programmer board and mount it on the actual circuit, it doesn't work.
I checked the following:
Vdd=High
VddIO=High
Oscout-oscin=floating
Vpp=Ground
Ain0-Ain1=analog voltage between 0-5Vs.
Vss=Ground
VssIO=Ground
Reset=High
I checked the connections, they seem to be fine. I took the PWM output from T0out pin. I tried not connecting anything to the T0out pin, but there was no PWM signal anyway.
I set clock of the chip to internal, at 10 mhz.
What do you think I am missing? Why doesn't it work in the actual circuit?
|
|
|
Profile
Quote
|
| Nino |
Posted 02-05-2006 at 10:57   |


Registered on : 10-01-2002
Messages : 33
OFF-Line
|
Some suggestions:
-Check the Vdd: is it stable? Is the power up good? What about the LVD?
-The watchdog is disabled?
-Keep the reset pin floating or in pull-up to Vdd with 10K-100K resistor.
-Put a push button on the reset pin, in order to give an external reset (low level) after the Vdd power on.
|
|
|
Profile
Quote
|
| Spkt |
Posted 02-05-2006 at 11:37   |

Registered on : 04-23-2006
From 0
Messages : 9
OFF-Line
|
Hi Nino,
Thanks for your reply.
How do I tell if watchdog is disabled? I did not enable it anywhere in my main program, is it enabled by default?
LVD (Low voltage detector) shuts down the chip if Vdd is well below 5V DC right? For my case, Vdd was at 5V, so can LVD be the problem?
[ This message was edited by: Spkt on 02-05-2006 15:19 ]
|
|
|
Profile
Quote
|
| Nino |
Posted 03-05-2006 at 08:32   |


Registered on : 10-01-2002
Messages : 33
OFF-Line
|
Hi,
the watchdog can be enabled by writing the relative option byte (HW watchdog, it starts by HW after the reset and cannot be stopped) or by writing the relative configuration register (SW wdg, can be started and stopped by SW). But at this stage I suggest do not use it.
The same for the LVD (you can choose between 3 different Vdd level), I suggest to introduce it when your code is working well.
My suggestion is to put in the reset pin a 100K resistor in pull-up to Vdd and a 100nF-1uF capacitor to GND in order to have in the reset pin a delay respect the Vdd (when the Vdd is rising at power on)
|
|
|
Profile
Quote
|
| Spkt |
Posted 04-05-2006 at 00:38   |

Registered on : 04-23-2006
From 0
Messages : 9
OFF-Line
|
Hi Nino,
Here's what I've tried:
I took the 5V supply and ground from the programming board to my breadboard circuit, to supply just the chip. I wanted to make sure the chip gets a neat 5V supply.
I checked the watchdog, it's on software. It's not enabled anywhere in the program.
LVD is disabled.
I've tried various combinations of 1uF,100nF, 56K, 1M capacitors on the reset pin as you described.
Still no luck!
I coded a very simple program that is attached. It just sends 128 to PWM0. I can run it on the indart onboard debugger and measure the PWM0 pin to be around 2.5V. So I suppose the code is working. But nothing happens as I take the chip and test it on the breadboard. I'm getting desperate :)
Could it be something about interrupts? The setting of the internal clock? Can you please take a look at the attached program to see if any of the settings is wrong?
| Attachments : | UNTITLED.FS4 | | | |
|
|
|
Profile
Quote
|
| Spkt |
Posted 08-05-2006 at 22:15   |

Registered on : 04-23-2006
From 0
Messages : 9
OFF-Line
|
Hi people,
I solved my problem, and for those of you who might need it sometime, here's how:
This quote comes from "indart stx five manual".
"The program works fine during debugging, but doesn’t work in standalone
mode
When debugging, inDART-STX downloads (together with the user application)
a monitor code into the target device. Additionally, inDART-STX modifies the Reset vector and several other memory addresses. Before to work in standalone mode, you should program the device with the DataBlaze programming utility. DataBlaze programs the microcontroller with
your program code and nothing else."
If you don't have the datablaze utility under your Visual Five folder, you can download it from:
http://www.softecmicro.com/download.html?type=browse&title=Software
Open Datablaze, load the .hex file compiled for your device and program the MCU. Now you have a MCU that's running!
|
|
|
Profile
Quote
|