#include <18f4550.h>
#device ADC=10
#fuses HS,NOWDT,NOPROTECT, BROWNOUT, NOLVP, PUT
#use delay(crystal=48000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS)
#include<flex_lcd416.c>
#define PIN PIN_A6
void main()
{
lcd_init();
for(;;)
{
lcd_gotoxy(1,1);
printf(lcd_putc,"Motor Start");
output_bit(PIN,1);
Delay_us(10);
}
}
Actually i m using a isis simulation...and i m not using any oscillator...................hi,
If I am reading your problem correctly.
When using an external crystal and HS, RA6 is a OSC pin.?
E
Is the circuit simulation or hardware?
Attach the circuit diagram.
Can you replace "output_bit(PIN,1); " these by output_high(pin_A6)
#use FIXED_IO( A_outputs=PIN_A6 ) add this line after ADC Initialize...
First you configure port pin was Input or output..
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include <18f4550.h> #device ADC=10 #fuses INTRC_IO,NOWDT,NOPROTECT, BROWNOUT, NOLVP, PUT // INTRC_IO - internal oscillator with pins 9 and 10 //used for input/output #use delay(crystal=4000000) // 4Mhz #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS) #include<flex_lcd416.c> #define PIN PIN_A6 void main() { lcd_init(); for(;;) { lcd_gotoxy(1,1); printf(lcd_putc,"Motor Start"); output_high(PIN); Delay_us(10); } }
If you want to drive output on pin A6. You have to use internal oscillator rather than high speed crystal.
Simply wrong.
It's the other way round. If you are not enabling the low frequency oscillator 2, RA6 is available as general purpose pin. There's no cause in the post #1 code that stops RA6 from working as GPIO with output function. The code in flex_lcd416.c would normally not configure RA6, but we can't check it.
So it might be another Proteus bug. You can debug code execution in Proteus if you want to know what's going on.
The datasheet says that the RA4 pin is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. The RA6 pin is multiplexed with the main oscillator pin; it is enabled as an oscillator or I/O pin by the selection of the main oscillator in Configuration Register 1H......Actually i didnt understand it quite well.....plz some explain ihow to config 1H register.....
The datasheet says that the RA4 pin is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. The RA6 pin is multiplexed with the main oscillator pin; it is enabled as an oscillator or I/O pin by the selection of the main oscillator in Configuration Register 1H......Actually i didnt understand it quite well.....plz some explain ihow to config 1H register.....
Yes, that's right. The problem is that you selected HS oscillator option although you are using internal oscillator.
I apologize for my previous answer to hemnath's post. He already recognized the problem.
Yes, I should have read it better. So I presume, the problem is solved.As did I, in my post #2.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?