CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Why does this code stop
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 25, 2015 3:58 pm     Reply with quote

I just compared your .LST file with mine and they're the same. So it's
got to be a hardware problem somewhere.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 25, 2015 4:04 pm     Reply with quote

You have the RS232 passing through the LS157. Are you sure it's selected
for the correct channel ?
Ringo42



Joined: 07 May 2004
Posts: 263

View user's profile Send private message

PostPosted: Wed Feb 25, 2015 4:05 pm     Reply with quote

That makes sense but if I load old code on the board it runs fine. That's what confusing me. This was part of a much larger program, I just wanted to start printing out the rssi values. When I started making changes is when it got weird. Old HEX Files Still Run. Unfortunately I don't keep old lst files.
_________________
Ringo Davis
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 25, 2015 4:09 pm     Reply with quote

Can you find or re-create a source file that will run on that board ?
Ringo42



Joined: 07 May 2004
Posts: 263

View user's profile Send private message

PostPosted: Wed Feb 25, 2015 4:25 pm     Reply with quote

The mux pin is what selects which 232 to use.
So when it is set incorrectly you should miss the message.
My issue is that is seems to just quit.

I tried this
Code:
#include "18f452.h"
#fuses hs,NOWDT,noprotect,put,nolvp
#device adc=10
#use delay(clock=20000000)

#define TX_PIN      PIN_C6
#define RX_PIN      PIN_C7
#define BAUD_RATE 19200
#define Mux_sel     PIN_E2
#define Mux_sel2     PIN_D4

#use rs232(baud=BAUD_RATE,xmit=TX_PIN,rcv=RX_PIN,errors,bits=8,parity=N,restart_wdt)

void main()
{
output_low(MUX_Sel);
output_low(MUX_Sel2);
printf("Start\r\n");
printf("Just set mux sel low \n\r");
delay_ms(254);
output_high(MUX_Sel2);
output_high(MUX_Sel);

printf("Just set mux sel high \n\r");
delay_ms(254);
   
while(TRUE);
}


and I get the message that the pin went low. Then the pin goes high (both of them) and it just stops.

Damn I'm an idiot...................................
I didn't catch the the while(TRUE); at the end. I always put that in the beginning with brackets around everything so it runs forever. That is what I have been looking for.

I moved it to the front and now it works.
Guess its been way too long since I worked on this stuff.
Thanks
_________________
Ringo Davis
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Wed Feb 25, 2015 11:35 pm     Reply with quote

Glad to see I'm not the only one that does things like that. Amazing how many times I have been part way through trying to explain to someone why something isn't working when I get to the "oh ..... never mind" part :-)

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group