Nevermind haha I have managed to make it through with some work, i had to also switch to a DC operated buzzer
Here is the code I have used:
#define _XTAL_FREQ 4000000
#define switch3 PORTBbits.RB4 // SWITCH INTERFACED
#define buzzer PORTCbits.RC0 // BUZZER INTERFACED
void BuzzerFunc(void)...
crystal frequency is 4MHz
The code i have tried is:
#include <p18cxxx.h>
#include <xc.h>
void main(void)
{
TRISC = 0; // making TRISC pins output
ADCON1 = 0x07; // making them digital pins
while(1)
{
RC0 = 1;
__delay_ms(5000);
RC0 = 0...
I have actually managed to get the seconds right with the right calculations and settings finally!
Would you mind taking a look at the merged thread that is on reply #4? I have a couple questions on there regarding my proteus design and things i need to change in it, here it is below:
#define...
4MHz is the the frequency of the oscillator (Fosc), to find the the frequency of the internal instructions (set in the timer0 control register, TMR0CON) you divide Fosc by 4. So the time for one instuction takes 1/frequency = 1/(4/4)
So far i have used TMR0L = any integer to preload the timer...
PLease help, I am fairly new to proteus and mplabx so I am trying to udnerstand how it all works. I am using PIC18F452 microcontroller.
I have this circuit in proteus shown at the bottom of the text.
The code:
#define _XTAL_FREQ 4000000
//Set the config bits
#pragma config WDT = OFF, BOR =...
I am using MPLAB X, everything is working great when I work on examples that require smaller or no preload at all, I do not understand why that is the case, is there a limit to the TMR0L?
Hello please help asap,
my specific case I have:
4MHz crystal -----> 1 / (4MHz / 4) = 1MHz timer
I...
I never asked to solve problems for me in fact i have been happy to do all the tedious mathematical work, even with the 'general' information you give me, which I still appreciate.
I have viewed the pdf multiple times and have even gone through the example on there before attempting it on my...
I believe my state variables to be H and T?
I have also read this
so does that mean i could make a pair of output equations and state vectors for each differential individually and model it in parallel on simulink?
sorry Lol everytime i work on the notebook i keep converting them to the variables in my problem, I'll change them now, problem is i have set T as y so there can be confusion. I will set y in SS equation as output from now
So i am aware that the outputs must be H' and T' therefore I believe the output equation in SS form to be
$$ output, y = \begin{bmatrix} Z' \\Y' \end{bmatrix} = \begin{bmatrix}
-0.061 & 0\\
0.10874 & -\frac{80}{11} \end{bmatrix}\begin{bmatrix} Z \\ Y\end{bmatrix}
+
\begin{bmatrix}
0.3636\\
0...
Summary:: This is similar to the examples of electrical circuit state space analysis, I have been trying to find the state space equations from the following non linear first order differentials but I keep getting stuck. Any help?
A) Started off from non linear equations:
$$y' =...
I have taken a look at example 2 of what you sent as it most relates, and I have tried working that example myself which i did successfully without much effort. but when I do it on my case, it becomes a much complex task..
In the example for first-order differentials, i had to reverse the...
How to represent this system in state space form?
where:
$$ x' = Ax + Bu \text{ and
}y = Cx + Du$$
I am trying to create a state space model based on these equations on simulink, need to find A, B, C and D but like I mentioned, i cannot find the solution when the differentials are not of...