|
|
View previous topic :: View next topic |
Author |
Message |
aasief
Joined: 12 Feb 2009 Posts: 12 Location: cape town
|
output_high(pin_Xn) problems |
Posted: Thu Feb 12, 2009 7:19 am |
|
|
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
|
|
Posted: Thu Feb 12, 2009 10:06 am |
|
|
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
|
|
Posted: Sun Feb 15, 2009 2:14 pm |
|
|
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: 1934 Location: Norman, OK
|
|
Posted: Sun Feb 15, 2009 2:26 pm |
|
|
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. |
|
|
|
|
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
|