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

output_high(pin_Xn) problems

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



Joined: 12 Feb 2009
Posts: 12
Location: cape town

View user's profile Send private message Send e-mail

output_high(pin_Xn) problems
PostPosted: Thu Feb 12, 2009 7:19 am     Reply with quote

I am busy designing a temperature an humidity controller as part of my design project for university.
I am controlling 4 outputs namely heater,cooler,humidifier and dehumidifier.The main programming is complete except for one small problem.My problem is that ccs only allows me to put one output on per port,and i need to have atleast 2 on at a time eg.
if i say:
if (temp<tempsetpoint) output_high(pin_d1) //d1=heater
if (humidity<humsetpoint)output_high(pin_d2) //d2=humidifier
if (humidity>humsetpoint)output_high(pin_d3 //d3=dehumidifier
if (temp>tempsetpoint)output_high(pin_d4) // d4=cooler
As u can c i mite need 2 outputs on at a time eg. cooler and humidifier.

but when i simulate it,only one output comes on,or it toggles on and off between the two that supposed to be on.

Has anyone ever had this problem before.
Ttelmah
Guest







PostPosted: Thu Feb 12, 2009 10:06 am     Reply with quote

First of all, this may well be a simulator problem. However the simulator _may_ be simulating a real problem, if it is one that allows you to simulate the electrical behaviour of the circuitry attached to the pins, and the load you have on them, is either too high, or is significantly capacitive.
The problem here is what is known as the 'RMW', or 'read modify write' problem. A search here, on these terms will find a lot of descriptions. If the simulator is simulating the external circuitry, and is showing this problem, then you need to consider re-designing the actual circuitry, or coding to avoid this (the posts you find will describe how to do this).

Best Wishes
wanbpicmaster
Guest







PostPosted: Sun Feb 15, 2009 2:14 pm     Reply with quote

Thanx for the advice.I am using proteus VSM simulation software and in my opinion it seems a really powerful program.i have opto triacs connected to the output pins but even wen i disconnect them the problem persists..im having a look at sum forums discussing RMW. thanx alot
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 15, 2009 2:26 pm     Reply with quote

First, this may be purely a Proteus issue.

Second, you have not posted any code so there may be more here than
what is showing involved in the problem.

Post your CCS version, your PIC version and the full section of code where
you are having this problem. Then we may have something to work with
when trying to help you.
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