Reply by matthewbuza1 February 20, 20072007-02-20
I put those changes in the code and i worked wonderfully. I've got
about a 1 sec window that needs to be refreshed throughout the code,
but it will save me from any infinite loops. Thanks for your help.

-matt

--- In m..., "matthewbuza1"
wrote:
>
> Thanks for the help ill check out the changes tomorrow morning and
> report back. Again, thanks for the advice.
>
> best,
>
> matt
> --- In m..., "old_cow_yellow"
> wrote:
> >
> > You have:
> >
> > mov.w #WDTPW+WDTCNTCL+ WDTSSEL,& WDTCTL
> >
> > This is correct -- provided that ACLK is already running at
32kHz.
> > Be aware that the watch crystal controlled oscilator often takes
> > a long time to start and there is no eazy way to check this.
> >
> > Right next to that, you have:
> >
> > bic.w #WDTTMSEL,&WDTCTL
> >
> > This is both unnecessary and incorrect.
> > It is unnecessary because WDTTMSEL is already zero.
> > It is incorrect because you will get a WDT PW violation.
> >
> > Next you have:
> >
> > bis.b #WDTIE,&IE1 ; Enable WDT interrupt
> >
> > This is unnecessary because WDT is in watchdog mode.
> >
> > --- In m..., "matthewbuza1"
> > wrote:
> > >
> > > Hey,
> > >
> > > I'm using a 1612 and i code in assembler. I'm trying to use
the
> > > watchdog in watchdog mode. I run solar cells for power, and if
> my
> > > gps does not have enough power it will get locked up in my
code.
> > I'm
> > > trying to set the watchdog for a 1000ms delay using the ACKL
> (32k).
> > A
> > > one second delay will give me enough time to run through a
> routine.
> > > I'm hoping to set the watchdog throughout the main body of my
> code,
> > > which takes about 3-4 secs to run, once this is completed i
want
> > the
> > > program reset. i've attached some sample code below. thanks
> ahead
> > of
> > > time for any help.
> > >
> > > -Matt
> > >
> > >
> > > ;watdog setup. 1000ms PUC reset?
> > > mov.w
> > #WDTPW+WDTCNTCL+WDTSSEL,&WDTCTL
> > > bic.w #WDTTMSEL,&WDTCTL
> > > bis.b #WDTIE,&IE1 ; Enable WDT
> interrupt
> > >
> > >
> > > -------This is where i would lock up if the GPS were not
> working.--
> > > -------The flag would not set.-----
> > > edgedet0 bit.b #URXIFG0,&IFG1 ;TESTING URXIFGx
> > > jnz dllrchar
> > > jmp edgedet0
> > >
> > > ;capturing the
> character
> > > dllrchar mov.b &U0RXBUF,adc_val2 ;
> > > cmp.b #dollar,adc_val2
> > > jeq flagdllr ;jump to set flag
> > > jmp mastercnt ;bad data start over
> > >
>

Beginning Microcontrollers with the MSP430

Reply by matthewbuza1 February 19, 20072007-02-19
Thanks for the help ill check out the changes tomorrow morning and
report back. Again, thanks for the advice.

best,

matt
--- In m..., "old_cow_yellow"
wrote:
>
> You have:
>
> mov.w #WDTPW+WDTCNTCL+ WDTSSEL,& WDTCTL
>
> This is correct -- provided that ACLK is already running at 32kHz.
> Be aware that the watch crystal controlled oscilator often takes
> a long time to start and there is no eazy way to check this.
>
> Right next to that, you have:
>
> bic.w #WDTTMSEL,&WDTCTL
>
> This is both unnecessary and incorrect.
> It is unnecessary because WDTTMSEL is already zero.
> It is incorrect because you will get a WDT PW violation.
>
> Next you have:
>
> bis.b #WDTIE,&IE1 ; Enable WDT interrupt
>
> This is unnecessary because WDT is in watchdog mode.
>
> --- In m..., "matthewbuza1"
> wrote:
> >
> > Hey,
> >
> > I'm using a 1612 and i code in assembler. I'm trying to use the
> > watchdog in watchdog mode. I run solar cells for power, and if
my
> > gps does not have enough power it will get locked up in my code.
> I'm
> > trying to set the watchdog for a 1000ms delay using the ACKL
(32k).
> A
> > one second delay will give me enough time to run through a
routine.
> > I'm hoping to set the watchdog throughout the main body of my
code,
> > which takes about 3-4 secs to run, once this is completed i want
> the
> > program reset. i've attached some sample code below. thanks
ahead
> of
> > time for any help.
> >
> > -Matt
> >
> >
> > ;watdog setup. 1000ms PUC reset?
> > mov.w
> #WDTPW+WDTCNTCL+WDTSSEL,&WDTCTL
> > bic.w #WDTTMSEL,&WDTCTL
> > bis.b #WDTIE,&IE1 ; Enable WDT
interrupt
> >
> >
> > -------This is where i would lock up if the GPS were not
working.--
> > -------The flag would not set.-----
> > edgedet0 bit.b #URXIFG0,&IFG1 ;TESTING URXIFGx
> > jnz dllrchar
> > jmp edgedet0
> >
> > ;capturing the
character
> > dllrchar mov.b &U0RXBUF,adc_val2 ;
> > cmp.b #dollar,adc_val2
> > jeq flagdllr ;jump to set flag
> > jmp mastercnt ;bad data start over
>
Reply by old_cow_yellow February 19, 20072007-02-19
You have:

mov.w #WDTPW+WDTCNTCL+ WDTSSEL,& WDTCTL

This is correct -- provided that ACLK is already running at 32kHz.
Be aware that the watch crystal controlled oscilator often takes
a long time to start and there is no eazy way to check this.

Right next to that, you have:

bic.w #WDTTMSEL,&WDTCTL

This is both unnecessary and incorrect.
It is unnecessary because WDTTMSEL is already zero.
It is incorrect because you will get a WDT PW violation.

Next you have:

bis.b #WDTIE,&IE1 ; Enable WDT interrupt

This is unnecessary because WDT is in watchdog mode.

--- In m..., "matthewbuza1"
wrote:
>
> Hey,
>
> I'm using a 1612 and i code in assembler. I'm trying to use the
> watchdog in watchdog mode. I run solar cells for power, and if my
> gps does not have enough power it will get locked up in my code.
I'm
> trying to set the watchdog for a 1000ms delay using the ACKL(32k).
A
> one second delay will give me enough time to run through a routine.
> I'm hoping to set the watchdog throughout the main body of my code,
> which takes about 3-4 secs to run, once this is completed i want
the
> program reset. i've attached some sample code below. thanks ahead
of
> time for any help.
>
> -Matt
> ;watdog setup. 1000ms PUC reset?
> mov.w
#WDTPW+WDTCNTCL+WDTSSEL,&WDTCTL
> bic.w #WDTTMSEL,&WDTCTL
> bis.b #WDTIE,&IE1 ; Enable WDT interrupt
> -------This is where i would lock up if the GPS were not working.--
> -------The flag would not set.-----
> edgedet0 bit.b #URXIFG0,&IFG1 ;TESTING URXIFGx
> jnz dllrchar
> jmp edgedet0
>
> ;capturing the character
> dllrchar mov.b &U0RXBUF,adc_val2 ;
> cmp.b #dollar,adc_val2
> jeq flagdllr ;jump to set flag
> jmp mastercnt ;bad data start over
>
Reply by matthewbuza1 February 19, 20072007-02-19
Hey,

I'm using a 1612 and i code in assembler. I'm trying to use the
watchdog in watchdog mode. I run solar cells for power, and if my
gps does not have enough power it will get locked up in my code. I'm
trying to set the watchdog for a 1000ms delay using the ACKL(32k). A
one second delay will give me enough time to run through a routine.
I'm hoping to set the watchdog throughout the main body of my code,
which takes about 3-4 secs to run, once this is completed i want the
program reset. i've attached some sample code below. thanks ahead of
time for any help.

-Matt
;watdog setup. 1000ms PUC reset?
mov.w #WDTPW+WDTCNTCL+WDTSSEL,&WDTCTL
bic.w #WDTTMSEL,&WDTCTL
bis.b #WDTIE,&IE1 ; Enable WDT interrupt
-------This is where i would lock up if the GPS were not working.--
-------The flag would not set.-----
edgedet0 bit.b #URXIFG0,&IFG1 ;TESTING URXIFGx
jnz dllrchar
jmp edgedet0

;capturing the character
dllrchar mov.b &U0RXBUF,adc_val2 ;
cmp.b #dollar,adc_val2
jeq flagdllr ;jump to set flag
jmp mastercnt ;bad data start over