pdswar
Joined: 18 Jul 2006 Posts: 33 Location: Maryland, USA
|
need help with PIC18F6722 ISR setup_timer_0() |
Posted: Wed Aug 16, 2006 2:09 pm |
|
|
Sorry, about the multiple posts. I disabled HTML in the previous post
I am using Internal Oscillator (INTRC) inside PIC 18F6722 operating at 8MHz. I want LCD_SCP signal (output from PIN F1) to oscillate at 1MHz.
#include <18F6722.h>
#device adc=10
#fuses INTRC, NOWDT, NOPUT, NOPROTECT, BROWNOUT
#use delay(clock=8000000) // Do I need this if I am using INTRC
#int_timer0
void int_timer0_isr()
{
output_high(LCD_SCP);
output_low(LCD_SCP);
}
void main()
{
setup_oscillator(OSC_8MHZ|OSC_INTRC);
set_tris_f(0x00); // Use all pins in Port F for outputs; LCD_SCP is output from PIN_F1
output_low(LCD_SCP);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_8); // I don't know how does this line of code work
enable_interrupts(int_timer0);
enable_interrupts(global);
}
I am getting a constant low signal @ LCD_SCP (output from PIN_F1). How can LCD_SCP oscillate at 1 MHz clock speed? |
|