Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:00 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Cause of CPU Exception #7

     Page 1 of 2    
Author Message
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 06:21am 29 May 2019
Copy link to clipboard 
Print this post

Hi all,

What causes "CPU Exception #7"?

Do I need to concentrate on hardware or software (or both?)?
(Hard to see how unchanged software would spontaneously start to misbehave but I need to check).

I am using a Silicon Chip LCD Backpack with connections to GPS, BMP180, HC-12 and DS18B20. It has worked well for at least a year but had started to reboot continuously.
I had made no changes.
I now get the error message "CPU Exception #7" with:
- old and new 170 chips using MM v 5.05.01 (and 5.04.08). I'm using MPLAXB IPE 5.2 (on Win 10) and a Pickit3 to erase then program each time. Then setting up the LCD options, then 3 fonts to the Library then the program.
- even with the bare LCD Backpack with none of the other devices connected
- I'm using the same program with sections commented out to test if it is one of the sensors (which I'm physically removing). I'm using auto-Crunch on MMEdit.

Suggestions would be appreciated . . .
Cheers,

Andrew


Edited by Andrew_G 2019-05-30
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 06:41am 29 May 2019
Copy link to clipboard 
Print this post

This is a "bus error on a load or store operation". The bus is the 32 bit bus that interconnects the various sub components of the MIPS CPU.

You should never see this as it signifies that the CPU tried to read or write from something (probably flash or RAM) and that operation failed. I have seen it in the past and the cause is most likely something to do with the power supply:
- Noise on the power supply (don't use a cheap USB charger) or low voltage.
- Faulty or incorrect capacitor on the Vcap pin.
- Poor decoupling on the 3.3V supply (are all the 100nF caps there?).
- Running the CPU at too high a clock speed (a 100MHz MX470 will do this if run at 120MHz).
- One of the Vcc or Vdd pins is not correctly soldered.

It is not firmware related so reflashing the firmware will not fix it. Also, it is not related to your BASIC program. It is something physical.Edited by Geoffg 2019-05-30
Geoff Graham - http://geoffg.net
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 06:51am 29 May 2019
Copy link to clipboard 
Print this post

Thanks so very much Geoff. I'll go looking and let you know.

Cheers,

Andrew
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 11:52pm 29 May 2019
Copy link to clipboard 
Print this post

Hi Geoff.

Power supply!

I had assumed that my Toshiba Win10 laptop would have OK USB ports - apparently not! I switched back to my Dell XP and it all worked. The Tosh. must be marginal.

Now that I've interrupted you - what do you use for power supply? (I am using cheap USB chargers - they may end up as phone chargers or be recycled).

Many thanks again,

Andrew
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 05:19am 30 May 2019
Copy link to clipboard 
Print this post

  Andrew_G said  ...what do you use for power supply?


I like to use the 'official' Raspberry Pi power supplies. Because they are mass-produced, they are cheap; and the new RPi3 PSUs are rated at 2.5A. This is enough to drive a 'big' MM and large TFT.

But do buy from a main supplier such as RS. If you buy cheap from auction sites then there is no guarantee of their quality.

Likewise with Battery-Packs should you need a mobile MM. I often use these to act as a UPS (i.e. RPi charger into Battery-Pack, then MM connects to Battery-Pack. Never fails me, and allows me to move from place to place without powering down the micromite.

WW
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 05:38am 30 May 2019
Copy link to clipboard 
Print this post

I am amazed that a modern laptop would be so difficult. The USB specs say that a device can draw up to 100mA without asking. The backpack can draw twice that but most laptops will supply that anyway. But apparently not a Toshiba.

On the bench I use a lab bench supply but for the final device I use a proper regulated plug pack like this: https://www.altronics.com.au/p/m8903-powertran-5v-dc-1a-fixed-2.1mm-tip-appliance-plugpack/

GeoffEdited by Geoffg 2019-05-31
Geoff Graham - http://geoffg.net
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 01:05pm 30 May 2019
Copy link to clipboard 
Print this post

  WhiteWizzard said  Likewise with Battery-Packs should you need a mobile MM. I often use these to act as a UPS (i.e. RPi charger into Battery-Pack, then MM connects to Battery-Pack. Never fails me, and allows me to move from place to place without powering down the micromite. WW


What battery pack do you use? Have you (or has anyone) found one which will have a "low voltage" signal to a pi so that it can shut itself down, and then when mains power is reapplied, toggle the power so that the pi starts up again?

Agree that charger to battery to MM or to pi is a good option which would protect the device from SD damage in the case of many power outages if they weren't too long--and also to provide mobility without shutting down.
Edited by lizby 2019-05-31
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 01:17pm 30 May 2019
Copy link to clipboard 
Print this post

  Geoffg said   I am amazed that a modern laptop would be so difficult.


It's not just laptops. In our DCs we have racks of hardware (mostly Dell servers), and the front USB socket which is crying out to have a USB disk inserted during a build can't provide the juice to run a 2.5" spinner... madness. What were they thinking - these things have dual or even quad redundant PSUs so it's not like power is at a premium.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 04:04pm 30 May 2019
Copy link to clipboard 
Print this post

Any idea if those USB disks follow the USB protocol for asking for more power?

It sure sounds like a missed opportunity.

John
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 02:21am 31 May 2019
Copy link to clipboard 
Print this post

Many thanks for your replies, I've just ordered some Pi PSUs from RS (thanks WW).
(A fraction cheaper than the Altronics ones and 2.5A vs 1A (sorry Geoff)).

Cheers,

Andrew

(I'll start another thread in a month or so but I am keen to know what setups Shedders have in their workshops. We are about to demolish our house and build a small McMansion with a big study/workshop for me (and one for Jackie too).
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 05:13am 31 May 2019
Copy link to clipboard 
Print this post

OK - taking my problem a little further. . .

With the new PSUs I'll be able to run my MMs happily but, as it stands, I have to use my old XP Dell to program them.

Is there any way I can use an external 5V source and connect to my Win10 Toshiba to run MMEdit to program and test them? - without blowing anything up that is.
Do any of you do anything similar?

Cheers,

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:14am 31 May 2019
Copy link to clipboard 
Print this post

Try a powered hub.

JimEdited by TassyJim 2019-06-01
VK7JH
MMedit
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 05:53am 31 May 2019
Copy link to clipboard 
Print this post

Hi Jim (et al),

Like one of these ?
(It runs off the laptop's power or you can add 5V input, eg from one the Pi PSUs on order).
I assume it is clever enough to sort out the earths and not sum too many +5Vs. If so, it should do the job.

Thanks,

AndrewEdited by Andrew_G 2019-06-01
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 06:17am 31 May 2019
Copy link to clipboard 
Print this post

That looks like an unpowered one.

However, if it uses a type C port from your laptop it ought to be able to acquire and then hopefully deliver enough power.

The powered ones have a PSU (aka wall wart).

JohnEdited by JohnS 2019-06-01
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 07:52am 31 May 2019
Copy link to clipboard 
Print this post

Hi John,
On closer inspection my laptop doesn't have a Type C USB (HDMI in the gloom looked like one). That particular one won't work - I'll keep looking.

Andrew
Edited by Andrew_G 2019-06-01
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 09:48am 31 May 2019
Copy link to clipboard 
Print this post

Something like this I guess
ebay

John
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2950
Posted: 09:57am 01 Jun 2019
Copy link to clipboard 
Print this post

@CaptainBoing,

You can get USB leads that have an extra type A for power delivery..

See this for example

Ebay link

Just use a battery bank or mains USB supply to supply the power grunt.


Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 10:08am 01 Jun 2019
Copy link to clipboard 
Print this post

G'Day All

Looking at the back pack info, it has a 5V input which should be the bee's knees.

Peter
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 12:42am 02 Jun 2019
Copy link to clipboard 
Print this post

Hello all,

Sorry to report "No joy" - yet!

I bought the USB hub I referenced above, plus a Type C female to Type A male adapter and I power it from a 5V 2.5A supply.

Same as before! On the Win10 Toshiba, I can program the MM170 with V5.05.01.HEX, load my 3 fonts to Library but when I use MMEdit to load the program, as it saves it, it pauses then flashes the error - non stop, only way to stop it it to erase the chip. The XP Dell does it all fine.

If I take a chip flashed and programmed on the XP and then connect it to the Win10 it Runs all OK. If I use MMEdit to download the same program - it misbehaves!
(I am using autocrunch BUT it is the latest version of MMEdit on the Win10 Tosh. and an older version on the XP - later today I'll play with an older version of MMEdit on the Win10 and reducing the size of the program).

Any other ideas?

Cheers,

Andrew






 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 04:49am 02 Jun 2019
Copy link to clipboard 
Print this post

G'day and Good news!

It was in my MMEdit settings.

Having changed from my Dell XP to my Win 10 Toshiba I ticked the MMEdit setting "Auto Crunch on Load" BUT NOT "Remove Line Numbers" - I thought that was part of the crunch.

So with lots of blank lines my code was bigger than it needed to be, and either failed to Load and Save or if it did, it was still too big to function - hence the "CPU Exception #7".

If I/we have maligned my Toshiba I am sorry - it is probably not at fault!
I now have a powered USB hub, which I will use, and I have found a use for the funny two-male-headed-USB A cable that BigMik alerted me to above - thanks Mick.

Many thanks to those who helped,

Cheers,

Andrew




 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025