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

In 18F4520 output_high(PIN_B2); instruction is being ignored
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: Mon Nov 28, 2011 7:13 pm     Reply with quote

Quote:
I have to be out on the road and moving,

Build a test setup in your lab that essentially duplicates the field environment.

Threads on "Output pin doesn't go high":
http://www.ccsinfo.com/forum/viewtopic.php?t=41315
http://www.ccsinfo.com/forum/viewtopic.php?t=44854
http://www.ccsinfo.com/forum/viewtopic.php?t=44550

ESD caused problems with i/o pins:
http://www.ccsinfo.com/forum/viewtopic.php?t=29373

Erratic program operation:
http://www.ccsinfo.com/forum/viewtopic.php?t=41964
http://www.ccsinfo.com/forum/viewtopic.php?t=46697&start=5
http://www.ccsinfo.com/forum/viewtopic.php?t=34563&start=7

Tips on proper layout for a 2-layer board.
http://www.ccsinfo.com/forum/viewtopic.php?t=42775
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Nov 28, 2011 7:38 pm     Reply with quote

The schematic looks pretty clean and A-_ok


I see there is an RF transmitter out there on the other end of a socket.
and that it draws about 10 IPA watts. This tells me you have RF galore in the vicinity. Quite a few years ago I designed a PIC controller all in ASM, before i discovered CCS, for an FM broadband exciter. The design worked great until the PA section was brought up to 50watts, and then I got an education in PICS in the RF environment.

Except for a few details -
( like U4a - which is a passing strange bit of circuit ... what DOES a comparator/opamp do when BOTH + and - are TIED TOGETHER LIKE THAT ??? is that REALLY right ?? if you don't have ERRORS set in your RS-232 receiver in the 18F part - you can go very sour right there. looks liek a malformed level shifter except for the crazy +/_ tie up , instead of a hysteresis comparator . You have a very very strange bit of circuit there.
also makes me wonder what is going on with programming of pin c6 in the 4520 as well )
if it were my design -
I would flat out change stuff-
even if I had to hack a PCB to do it.

1- I would use ONLY fastIO and define all my port tris manually

2- I would add a simple but effective resistive isolator between the
SOURCE ( output pins) pic and the receiving pic using a 5.1k resistor in series and ideally - shunted by 100 pf at the INPUT pin of the receiver.

If these two changes don't lead directly to solving your problem -
then there MUST be a deeper code problem that is well hidden.

BTW: what is the data format going to the data radio socket??
and the effective baud -- RS-232 right ?
My interest is piqued here because I have a ready to ship project that uses 3 pics on the same PCB -
sharing functions and common precision timing control, AND-ed serial communications and managing a data logger - - an 18f4620, 16F887, and 16f886 ... LOL - I am doing inter process communication by toggling two lines between the 40 pin pics - and yes - there is a 5.1 k resistor between those pins. No problems with any of that.
Very Happy
jlucas



Joined: 08 May 2011
Posts: 41
Location: Carthage, MO

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 28, 2011 8:13 pm     Reply with quote

asmboy, I'm not totally unwilling to cut a trace on the board; I would, however, like to avoid that if possible. It may come down to that, though.
Quote:
how do you know that the problem is not from those other leds being ON TOGETHER -and finally putting the PIC pin regulator into current limiting ?

As a matter of fact, I don't know that! Come to think of it, when it failed, I had two of these LED on at the same time. This makes a lot of sense. I put some resistors on the LEDs, and as soon as I can figure out why a different section of the code stopped working, I'm going to go road test it.

BTW, I'm using RS232 at 57,600 baud to communicate between the 18F4520 and the Aerocomm AC4790 RF module in both the TX and the RX, and it works like a charm!
_________________
Always remember, things are never so bad that they can't get worse.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 28, 2011 8:59 pm     Reply with quote

You don't have to cut a trace. Get a low-cost hot air desoldering station:
http://www.amazon.com/Aoyue-850A-Hot-Rework-Station/dp/B000I5JXA0
We have that one. Also buy the appropriate tip for the SMT package that
you want to remove.
jlucas



Joined: 08 May 2011
Posts: 41
Location: Carthage, MO

View user's profile Send private message Visit poster's website

PostPosted: Tue Nov 29, 2011 3:43 pm     Reply with quote

Well, this project has disintegrated into total chaos. I have two 1-bit variables that are spontaneously changing their values without any instructions to do so. I have if statements in two different parts of the program that essentially a say, if(x==0) do THIS; else do THAT. I initialize x to 0, and there is no instruction to change it, but the program is doing THAT.

I'm going to shelve this for a day and make another run at it tomorrow.
_________________
Always remember, things are never so bad that they can't get worse.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Nov 29, 2011 3:53 pm     Reply with quote

time to really dig into your LST file !!!!

you have memory indexing trouble ... bet u a $$$
classic memory corruption due to code i fear.


what other vars are LOCATED in memory PRIOR to the byte that contains
your INT1 ' ??
you want to figure out from the LST file what memory location has the int1 one as one of its bits. a lower addressed var , usually an array is
being mis indexed


i had a devilish problem like that once where i was filling elements in an array of bytes - then boxcar averaging as more data was added to the array.

but a mishandled ( by me ) pointer overshot the highest element ( ccs does not bounds check for us ) and began altering higher addressed VARS that were not part of the array. Just as with your issue - it did not begin to screw thing sup at first - but the longer it ran - eventually an obvious fatal problem would arise. but after cold start -w as fine again.


a messed up pointer or a direct addressed array that has been indexed d beyond its declared bounds can do just what you are seeing
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