Test 7. LED turn on after pressing switch on RB4 In the loop two routines are called: turning LED on and off. Both routines call also routine for delaying, generating delay of 48.6 ms: Tcm x 3 cycles x op = 108 us x 3 x 150 = 48.6 ms On the picture below on […]
Continue reading…
Uncategorized
Morse code: PIC generated with PWM
Test 6. Morse code: PIC generated with PWM Generating the word PIC in Morse code using PWM module. Generating acoustic signal with PWM was described in previous test. Routine del contains nested loop. Two general purpose registers l2 and l3 are decremented. l2 is first cleared and then is decremented in the inner loop with […]
Continue reading…
Acoustic signal of 1 kHz frequency generated with PWM module
Test 5. Acoustic signal of 1 kHz frequency generated with PWM module
Continue reading…
All LEDs connected to portb blink with different frequencies
Test 4. All LEDs connected to portb blink with different frequencies For the internal generator frequency of 37 kHz the machine cycle equals 108 us. In order to achieve LEDs blinking with various frequency we use TMR0 presca- ler. Frequencies are deployed within the range: 55 ms to 7.079 s according to the table:
Continue reading…
Turn on the LEDs connected to various lines of port B
Test 2. Turn on the LEDs connected to various lines of port B
Continue reading…
Turn on the LEDs connected to various lines of port B
Test 3. Turn on the LEDs connected to various lines of port B
Continue reading…
Turn the LED on for the calculated period of time.
Test 1. Turn the LED on for the calculated period of time. We define two registers count1 and count2 in the data memory GPR (General Purpose Registers), that starts at the address 0x20.
Continue reading…
TIMERS AND COUNTERS:TIMERS
TIMERS Timer0 will be covered first, and in more detail, as a prototypical timer, and discussion and examples for the use of Timer1 and Timer2 will be provided. The use of timers internal to microprocessors is a bit more complicated than what we have been doing so far because there is a considerable amount of […]
Continue reading…
CONTROLLING THE OUTPUT AND READING THE INPUT:GENERATING OUTPUTS
GENERATING OUTPUTS It will be easier if we learn to control the outputs first because we can do this from programs that we write without the need for any additional hardware or input signal. We will start with the simple control of LEDs and proceed to the control of the two- line LCD that is […]
Continue reading…
CONTROLLING THE OUTPUT AND READING THE INPUT:GENERATING OUTPUTS
GENERATING OUTPUTS It will be easier if we learn to control the outputs first because we can do this from programs that we write without the need for any additional hardware or input signal. We will start with the simple control of LEDs and proceed to the control of the two- line LCD that is […]
Continue reading…