Exception Processing

basically miscellaneous, if it doesn't fit another sub-forum enter it here, we might even promote it to its own sub-forum
danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Exception Processing

Post by danlee58 »

I have a SuperPro board running a C program. It runs for a while, then seems to stop. I have some printf statements, and my terminal doesn't receive any output when the program stops.

Are there any exceptions that could cause the program to stop executing?
How can I detect these exceptions?



olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: Exception Processing

Post by olzeke51 »

Haven't done a SuperPro yet, and not much C - but memory issues came to mind.
this could also imply stack usage/overflow. not sure how much memory clean up MakeItC does.
--- are there any faults printed out ??, or the header/version info like on a restart???
- you mention "exceptions" - have you set up any interrupt vectors? If the proper "return" isn't
used - your stack will corrupt.
-
just some thoughts - you were a little vague on details. olzeke51

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Exception Processing

Post by danlee58 »

I have one interrupt set, any others should be set in the Coridium included files.

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: Exception Processing

Post by olzeke51 »

Hi, Good morning - I was looking over your previous posts -- Good info -- 'cuz I want to add some Arduino shields
to a ProStart Board - (I haven't graduated to the SuperPro YET). I'll have to look at the 5v turn on issue a little more.
I'm currently evaluating the LPC812 (it was free!) and want to put a data-logger (SD card) shield with it - but I do BASIC
right now.
'
Sometimes we overlook history, but can history repeat itself. Are you using the board that you had a 'high 3.3v' on it (
Back in August you had some 'zero' AD readings that caused you some program issues. In June you had some
spurious interrupts due to a ground loop -- that sounds like your "exceptions" that you are referring to.
'
Hope this helps get the old noodle going !

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Exception Processing

Post by danlee58 »

I am going to strip down the code to the minimum required to perform the main function. I think that debugging will be easier in that condition.

I really want to trap the exception status to see what is going on.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Exception Processing

Post by danlee58 »

I ran a stripped down version of my code, and it seems to run OK. I removed all of the 'printf' statements, but now I have no window on the processing. I want to install 4 LEDs on P0.30(P0.29 is output), P2.4, P2.3, and P2.2.

Will these outputs drive an LED directly?

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: Exception Processing

Post by olzeke51 »

Good question -- info from the data sheet isn't 100% clear
it states up front --
All GPIOs support a new, configurable open-drain operating mode.
Single 3.3 V power supply (2.4 V to 3.6 V).
Imax for supply or ground current is 100ma - total, I think the chip uses 50ma....
**
on page 47 it shows a chart that only goes upto 10ma output
and the Voutlow is about .6v !!!
**
the old style LEDs used 10-20ma with a current limiting resistor
I don't think 5-7ma is very bright for an LED unless you are focused/piped
I noticed Coridium's "BOOT" LED pulls 8 to 10ma (330 ohm limiting R) but I
think it is used/driven by the USB/serial dongle. --- WHOOPS !
the BLINKY.bas drives IO(74) - which should translate to the "BOOT" pin - p2.10
** not too wild about these modern 3.3v lowpower chips !!!
NOT SURE what these modern SMD LEDs take -- well the 'BOOT' LED is about 8ma!!!
using the chart on page 47, with the Voutlow being around .5v that would be 8ma.
still within the parameters for the chart. LOOKS LIKE A GO !! (with 330+ ohms)@ 3.3v
** well it just dawned on me -- the LED has a voltage drop that would subtract from the 3.3v
[minimum of .7 upto about 1.2v] this would affect OHM'sLaw and the current -- SO you will
still be within the Imax parameters for 4 LEDs - ]
*

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Exception Processing

Post by danlee58 »

I am tying the LEDs to +5.0. They have about 1.7 V drop, so that will leave 3.3 volts. If the VoutLow is 0.6 V, then I'll have 2.7 V. I need a resistor that will drop 2.7 V @ 0.020 A. That should be something close to 135 Ohms.

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: Exception Processing

Post by olzeke51 »

personally - I think you are pushing to the max --- limits
p0(29 & 30) AFAIK are not 5v tolerant so I would increase my R
can you get by with about 10-12 ma for your LEDs --
**I assume you are just debugging your circuit/PROGRAM - not final assy.
**
**ANY THOUGHTS Basicchip??

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: Exception Processing

Post by olzeke51 »

if you need that much current - try a ULN2003 ?? or possibly a 7407-type
transistors are another option but
IN ANY CASE from what I understand - you will need a current limiting resistor
be it the base of the transistor or the TTL type of chip.
** don't know if I like these lowpower 3.3v chips --

Post Reply