| View previous topic :: View next topic |
| Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 25, 2015 3:58 pm |
|
|
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
|
|
Posted: Wed Feb 25, 2015 4:04 pm |
|
|
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
|
|
Posted: Wed Feb 25, 2015 4:05 pm |
|
|
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
|
|
Posted: Wed Feb 25, 2015 4:09 pm |
|
|
| Can you find or re-create a source file that will run on that board ? |
|
 |
Ringo42
Joined: 07 May 2004 Posts: 263
|
|
Posted: Wed Feb 25, 2015 4:25 pm |
|
|
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
|
|
Posted: Wed Feb 25, 2015 11:35 pm |
|
|
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 |
|
 |
|