Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:04 29 Apr 2024 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 : CPU exception

Author Message
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 10:09am 02 May 2015
Copy link to clipboard 
Print this post

Hi

I was playing around with a rotary encoder and got this error with a
Micromite MKII running 4.6B



After the restart the program crashed as it did not start from the beginning
Anybody got any ideas or seen this before.

After staring the program again it all seems normal and has not crashed again ?

Regards
Jman


 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 12:27pm 02 May 2015
Copy link to clipboard 
Print this post

This exception is caused by the CPU trying to access a non existent address. Normally it indicates a serious bug in MMBasic but because it is not repeatable that does not seem to be the cause.

Another cause that I have seen is noise on the power or ground lines to the chip, or the capacitor on Vcap is not up to scratch. The telling symptom is that the exception occurs at random, which seems to match your case. Using a lower CPU speed often reduces the problem although the best course is to correct the power issue.

Geoff
Geoff Graham - http://geoffg.net
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 01:27pm 02 May 2015
Copy link to clipboard 
Print this post

Hi Geoff

Thanks for the reply.
The chip is a PIC32MX170F256D-50I/PT so I was running it at 48MHz
I have reduced this to 40MHz and the error is gone
This only occurs when use a rotary encoder (code from the manual)
and you spin the encoder quickly and continually swapping directions.

The PCB is a well grounded (copper pour) with lots of decoupling.
5V regulator into a 3.3 regulator. I have tried a known good power
source with the same result. Rather odd.
I have changed the PIC32MX170F256D-50I/PT and this has cured it
at 48Mhz

Thanks for the help

Jman


 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024