RESET_CPU()

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

RESET_CPU()

Post by stefan.erni »

Hi Ben
Is there a way to reset the cpu like an another compiler?

///////////////////////////////////////////////////////////////// Control
// Control Functions: RESET_CPU(), SLEEP(), RESTART_CAUSE()
// Prototypes:
_bif int8 restart_cause(void);
_bif void reset_cpu(void);
_bif void sleep(void);
_bif void sleep(int8 type);

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RESET_CPU()

Post by Benj »

Hello,

Yes there is usually a way. Mostly depends on which micro you're using?

If you look at the CAL ICD C file for the family you're interested in then right at the end is a software reset routine you can use via C code.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: RESET_CPU()

Post by stefan.erni »

Hi Ben
Thank You. I saw it in the ICD-File. I have to enable the watchdog an run a whileloop for ever.

something else I have.
I used the eeprom in the chip.The bad side effect is, that if I download the program to the chip, it's takes 40seconds time to
write EEdatamemory. But I use only 3Byte in the eeprom and I write it in a (setup setting programpart). do I have to wait every time I Programm it or can I choose "only burn program" somewhere

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: RESET_CPU()

Post by stefan.erni »

Hi Ben

I found the "Problem". I removed the Initial Value (0,1,0x2,0x03,'A','b',"Hello") from the EEprom-properties and now there is no 40seconds waiting time for programing anymore.

Post Reply