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 support@ccsinfo.com

#use

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

#use
PostPosted: Fri Oct 28, 2016 12:47 am     Reply with quote

Good day,
Is it allowed and politically correct to use

#use fixed_io(X_outputs=outx)

inside the program to dynamically change definition of the ports?

I have noticed that once I do not declare the output as a fixed one then the output does not stay permanently ON after activation.

output_high (SLOT0); or output_low (SLOT0); will be deactivating after random time. It stays permanently ON only if I declare it as a fixed one.

Advise please. Thnx
_________________
Help "d" others and then you shell receive some help from "d" others.
Ttelmah



Joined: 11 Mar 2010
Posts: 19366

View user's profile Send private message

PostPosted: Fri Oct 28, 2016 1:09 am     Reply with quote

If it is going off, something in your code or hardware is turning it off.

None of the I/O statements have a time component.

However it is important to understand the I/O nature of the PIC. You may be hitting the RMW (read modify write) problem. Depends on what PIC is involved (later chips allow writing to the latch as opposed to directly to the 'port', to avoid this).

Look at:
<http://www.ccsinfo.com/forum/viewtopic.php?t=48904&highlight=pic+rmw+problem>
<http://www.ccsinfo.com/forum/viewtopic.php?t=33425&highlight=pic+rmw+problem>
<http://www.ccsinfo.com/forum/viewtopic.php?t=45038&highlight=read+modify+write>

Dozens of other threads here, and much more generally on-line.

Key thing is that it implies a hardware overload (or capacitive load meaning the pin is taking significant time to change). This really needs to be fixed...

However since locking TRIS seems to be affecting things, I'd be looking at anything else in your code that might affect TRIS. Any TRIS statements?. Is the pin involved one that the compiler may be wanting to use for a peripheral? (remember if - for instance, the pin is one like a serial pin, then a serial setup, would override the TRIS, but then fixed_io would set it back at the next I/O statements).
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Fri Oct 28, 2016 1:32 am     Reply with quote

18F4620 pin RB1 which is INT1 and AN10, AN function is set to off so it can only be INT1 which I do not use. I do not declare pull ups, is it possible that pull up gets ON if fixed IO is not used? This would explain why led goes off...

I have checked the code and there is no control on this pin apart of one trigger.

Thnx
_________________
Help "d" others and then you shell receive some help from "d" others.
Ttelmah



Joined: 11 Mar 2010
Posts: 19366

View user's profile Send private message

PostPosted: Fri Oct 28, 2016 1:34 am     Reply with quote

What is the current limiting resistor on your LED?.
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Fri Oct 28, 2016 1:43 am     Reply with quote

470
_________________
Help "d" others and then you shell receive some help from "d" others.
Ttelmah



Joined: 11 Mar 2010
Posts: 19366

View user's profile Send private message

PostPosted: Fri Oct 28, 2016 1:49 am     Reply with quote

Hmm. Big enough.

_Something_ in your code must be affecting the TRIS. Any 'input' statement on port B, could potentially override it. An 'input_b', would set all the bits to input for example. This is what 'fixed_io' would override.
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Fri Oct 28, 2016 1:56 am     Reply with quote

Thnx, i dig it and report
_________________
Help "d" others and then you shell receive some help from "d" others.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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