PIC Reboot all 121 sec reboot..

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

PIC Reboot all 121 sec reboot..

Post by Rudi »

Hi

only a question:
at First time .. I do not know what i make false,
in a second think.. perhaps my config bits go wrong..

i simple test a LCD with Generic LCD Compo.

Pseudo Code:

Start
.i = 0 ( Type Integer )
do While 1
LCD.PrintNumber(.i)
delay (1) ..1 Second
.i = .i + 1
LCD.ClearLine(0)
loop


but all 121 sek ( 0..120 ) the Board start new...
in Simulation is ok.

PIC24 FJ 256 GB 106

20MHz Crystal ( div 5 )

CLK Speed 32000000

Supplementary Code:
( 1s = 1s )
#define MX_CLKS_PER_INST 16

Watchdog Timer is disabled.
_config3: 0xffff
_config2:0x43be
_config1:0x4e7f

LCD Data connect: RE0..RE7
RS: RB15
E: RD11
LCD_USE_Write: Yes
RW: RD5

in code i set manually Backllight ( RD1) and Contrast ( RD2 ) to : 1

someone a suggestion Tip?
i am not sure, .. i post the example..

TY!
Best wishes
Rudi
;-)

btw:
I try to make a User_Compo for the LCD at the SHURE Board 11115..
the backlight and contrast bit after LCD.PrintString will be later in the Compo as a Initialise..
this only a Test for me, that work the pins..

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: PIC Reboot all 121 sec reboot..

Post by Benj »

Hello Rudi,

I've checked out your config settings and they look ok, also just checked them against the datasheet to double check and all they seem to check out.

Hmmm, is it always exactly 121 seconds when it resets?

I noticed in the supp code window you have added a "MX_CLKS_PER_INST" define which might cause some problems with timings but shouldn't cause resets.

You could use a C icon at the very start of your program to pass the value of the RCON register to a Flowcode variable to allow you to display it and see what caused the last reset.

Create a Flowcode UINT variable called regval and use this C code to pass the register value to the variable.

Code: Select all

FCV_REGVAL = RCON;
Convert the value to a hex string and display the string on an LCD. Page 72 of the device datasheet details what the RCON register values mean.

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: PIC Reboot all 121 sec reboot..

Post by Rudi »

Hi Benj,
thank you very much for your Time and Help!
And again a New Tip from you ( how i can set a Variable in FC to work with it)
Ty! i will learn allways from you again!
..



In a First Try, 0x83 was the Value
in a second the Value was 0x93

Not exact 121 sec..
121 sec + the Start Time..
it will display 0....120 then go out and start again.

I try to encode the Value ;-)...( i think i need a little help ;-).... )
.. Datasheet side 72... ok..

TY!
Best wishes!
Rudi
;-)



EDIT:

0x83
UART3 Transmitter 83 0000BAh 0001BAh IFS5<3> IEC5<3> IPC20<14:12>

0x93
Input Capture 9 93 0000CEh 0001CEh IFS5<13> IEC5<13> IPC23<6:4>



After i removed the PicKit3.. ..
the First i get is a 0x3 ( Timer1)

then allways a 0x13 (ADC1 Conversion Done)

if i reconnect the Board with Power Supply
the First i get is a 0x3 ( Timer1)

then allways a 0x13 (ADC1 Conversion Done)

..

I think i must deactivate the ADC1 Function?
..

I think i must set the Portpins D1, D2 to digital?

..

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: PIC Reboot all 121 sec reboot..

Post by Rudi »

Hi Benj,

ok... i am little bit unsure.. but i think there is a big cross mistake..
i hope i can all reconstruct and description right:


I make a new project, only the LCD i connect and i must set the CLK to 12000000 and must make a supplementary Code with
#define MX_CLKS_PER_INST 16

so delay 1s is 1s.
like the project here in thread.

Because i want to test, where the mistake is, why this reboot... so i change the strategie for displaying...
i have make the same project with RS232 ( without LCD ) and set the RS232 Software to 19200.
same suppli code , same define.
but
^^^
delay 1s is 0.125 s
btw: In Software Mode .. the win terminal baudrate is 1/2 ... : 9600 - so i can read the sendstring by RS232.
btw: In Hardware Mode ..the win terminal baudrate is 2x .....: 38400 - so i can read the sendstring by RS232


so i test and change clk to 32000000 and the define to
#define MX_CLKS_PER_INST 2

delay 1s is now 1s
all run then ok.

in the third step, i added again the lcd ( remeber.. 1s is 1s at 12000000 and INST 16 ) and want look how the delay and reboot here is.
..
ups..
delay 1s is 1s
no reboot more.
;-)
but why ?


so i think the project with the RS232 is setting or make a other code like the first?
i added now project 2 and project 3.

in a simple Test, i copy the flow code from reboot project into the rs232 LCD Project.
i delelte the RS232.. and the code runs delay 1s is 1s and no reboot.. at 32000000 and ÍNST 2
..
i can not declare this magic ;-)..

Ok. TY
Best wishes
Rudi
;-)


edit:
"Project 4"

I make a new Compo for the Shure Board LCD at 11115 Board.
Btw: Thank you Benj for Component Video and Jordy for the How to, this was exact the right steps for next ways..

And i make a new Projekt, ( Project 4 )
32000000 CLK,
#define MX_CLKS_PER_INST 2
delay 1s = 1s
no reboot.. runs well.
...
mhm..
i can not declare whats happend in the first ..;-)

..

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Think found the base timer bug ...

Post by Rudi »

Hi..
... i will paused in this..
because i have make little tests with Timing and Delay and have found the ms delay and the s delay is not the same.
http://www.matrixmultimedia.com/mmforum ... 54&t=14797
i will make later time go on again here.
Best wishes.
LG
Rudi
;-)

Post Reply