Never done flow chart before cause I go with the flow in my mind and get stuck.
The last box is my issue
Run mode and over current mode. that's a good idea. What do you have in mind ?
The last feature was indeed meant to be a protection feature. I wanted the supply to switch output off and stay that way if the supply is overloaded. I wanted it to reset when the user reduce the Voltage.
Right now it is labelled as overload.
In over load it checks for Max current value. It detects ADC and shuts off relay. Relay turns on when the voltage ADC is reduced to 0.
I wanted to add;
1. Power switch feature. That would keep the output relay off display Standby. There would be a Standby relay too. The display will be powered separately and not from the main Tx. So one Switch input and one more relay out. I still have 2 ports unused.
I like need to cycle through this Standby loop for ever until Stby is pressed. Once pressed the main code should begin. that is display start up msg point from the flow chart. If pressed again to power down, the msg should appear shutting down and go back to stby loop.
2. Is to display msg when overloaded and stay there until voltage is brought down. I like to display the msg as long as the voltage is not brought down and switch back to normal display mode when the output relay is re triggered by 0V setting.
The power switch feature I haven't tried coding yet but I tried few ways to do the overload display msg. Partial luck
The commented out code works if I replace the "if" with "while" at the beginning. but one problem.
It changes display to overload msg, and sound the alarm and stays there, it does not come out of it even the voltage is reduced. I cannot figure out a way to come out of it. The darn thing get's stuck in tht loop once overload is activated.
PS. I am not using ISR yet
The last box is my issue
Run mode and over current mode. that's a good idea. What do you have in mind ?
The last feature was indeed meant to be a protection feature. I wanted the supply to switch output off and stay that way if the supply is overloaded. I wanted it to reset when the user reduce the Voltage.
Right now it is labelled as overload.
In over load it checks for Max current value. It detects ADC and shuts off relay. Relay turns on when the voltage ADC is reduced to 0.
I wanted to add;
1. Power switch feature. That would keep the output relay off display Standby. There would be a Standby relay too. The display will be powered separately and not from the main Tx. So one Switch input and one more relay out. I still have 2 ports unused.
I like need to cycle through this Standby loop for ever until Stby is pressed. Once pressed the main code should begin. that is display start up msg point from the flow chart. If pressed again to power down, the msg should appear shutting down and go back to stby loop.
2. Is to display msg when overloaded and stay there until voltage is brought down. I like to display the msg as long as the voltage is not brought down and switch back to normal display mode when the output relay is re triggered by 0V setting.
The power switch feature I haven't tried coding yet but I tried few ways to do the overload display msg. Partial luck
This code is now what works.void OverLoad(){
if(Amps>=1023){ // If Current reaches MAX 10Amps,
Rly = 0; // Output off
/*Alarm_high();
Lcd_Cmd(_LCD_CLEAR);
Delay_ms(500);
Lcd_Out(1,1,txt9a); //overload ms
Lcd_Out(2,1,txt9b); // reset msg
Delay_ms(500);
Alarm_high();
Lcd_Cmd(_LCD_CLEAR); */
}
if(Volts<=1) { // If Volts out is 0V,
Delay_ms(100); // Wait for 100ms before -
Rly = 1; // Switch back on Relay
}
}
The commented out code works if I replace the "if" with "while" at the beginning. but one problem.
It changes display to overload msg, and sound the alarm and stays there, it does not come out of it even the voltage is reduced. I cannot figure out a way to come out of it. The darn thing get's stuck in tht loop once overload is activated.
PS. I am not using ISR yet
Last edited: