View previous topic :: View next topic |
Author |
Message |
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
oscillator pins in 16f676[SOLVED] |
Posted: Mon Mar 14, 2016 7:07 am |
|
|
hi..
how to use oscillator pins as a normal i/o's in pic16f676
i have tried INTRC_IO flag but still not working
i am using ccs5.008 version and crystal 4MHZ
thanks in advance ... _________________ KaalaayaTasmaiNamah:
Last edited by Madhu_k_r on Mon Mar 14, 2016 11:12 pm; edited 1 time in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Mon Mar 14, 2016 7:25 am |
|
|
Please post your program. We need to see what you're doing to tell you what is wrong.
Jay |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Mon Mar 14, 2016 7:28 am |
|
|
post your program including #fuses and you #use delay statement so i can see what all you have going on. |
|
|
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
|
Posted: Mon Mar 14, 2016 7:31 am |
|
|
this is my main program
#include <CHAIR_CONTROL_ONLY.h>
void main()
{
delay_ms(200);
while(TRUE)
{
output_low(pin_a4);
delay_ms(200);
output_high(pin_a4);
}
}
#include <16F684.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOPROTECT //Code protected from reads
#FUSES INTRC_IO //Internal RC Osc,no CLKOUT
#FUSES NOMCLR
#use delay(crystal=4000000) _________________ KaalaayaTasmaiNamah: |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Mon Mar 14, 2016 7:36 am |
|
|
comments
1) the order of the code is totally wrong ! Please consult either the CCS manual,any of the examples int he examples folder or the code library here
2) your subject says 16F676 yete the processor header is for 16F684A. THAT is troubling... WHICH is it ?
3) chair_control_only.h is not known to me, it COULD be affecting your program.
Jay |
|
|
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
|
Posted: Mon Mar 14, 2016 7:42 am |
|
|
temtronic wrote: | comments
1) the order of the code is totally wrong ! Please consult either the CCS manual,any of the examples int he examples folder or the code library here
2) your subject says 16F676 yete the processor header is for 16F684A. THAT is troubling... WHICH is it ?
3) chair_control_only.h is not known to me, it COULD be affecting your program.
Jay |
i am sorry it's 16f676.h _________________ KaalaayaTasmaiNamah: |
|
|
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
|
Posted: Mon Mar 14, 2016 7:43 am |
|
|
#include <16F676.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOPROTECT //Code protected from reads
#FUSES INTRC_IO //Internal RC Osc,no CLKOUT
#FUSES NOMCLR //Master Clear pin used for I/O
#use delay(crystal=4000000) _________________ KaalaayaTasmaiNamah: |
|
|
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
|
Posted: Mon Mar 14, 2016 7:45 am |
|
|
[quote="Madhu_k_r"][quote="temtronic"]comments
1) the order of the code is totally wrong !
thanks for your reply
but what is wrong with the order
i just want to make that pin high and low
i coudn't make it
i have tried it in proteus simulation _________________ KaalaayaTasmaiNamah: |
|
|
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
|
Posted: Mon Mar 14, 2016 7:46 am |
|
|
[quote="Madhu_k_r"][quote="temtronic"]comments
3) chair_control_only.h is not known to me, it COULD be affecting your program.
and chair_control is just a project name _________________ KaalaayaTasmaiNamah: |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Mon Mar 14, 2016 8:06 am |
|
|
Code: |
#use delay(crystal=4000000) |
read the CCS manual please --
the line above contradicts what your fuses say!!
RTFM and your problem will go away....... |
|
|
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
|
Posted: Mon Mar 14, 2016 11:00 pm |
|
|
thank you "asmboy" and all
i have changed to #use delay(internal=4000000)
and working now _________________ KaalaayaTasmaiNamah: |
|
|
Madhu_k_r
Joined: 12 Jan 2016 Posts: 26 Location: Bengaluru
|
Re: oscillator pins in 16f676 [SOLVED] |
Posted: Mon Mar 14, 2016 11:11 pm |
|
|
Madhu_k_r wrote: | hi..
how to use oscillator pins as a normal i/o's in pic16f676
i have tried INTRC_IO flag but still not working
i am using ccs5.008 version and crystal 4MHZ
thanks in advance ... |
_________________ KaalaayaTasmaiNamah: |
|
|
|