View previous topic :: View next topic |
Author |
Message |
ebalvis
Joined: 27 Apr 2011 Posts: 2 Location: Spain
|
problem output RB6 RB7 PIN |
Posted: Wed Apr 27, 2011 1:49 am |
|
|
hi all, I can not activate the pins RB6 and RB7 as output.
The following example activates RB1. RB7 is always 0 volts.
The programming of the PIC with MPLAB ICD3 performed using MPLAB IDE.
Any ideas?
Code: |
#include <16F818.h>
#FUSES NOWDT , NOPUT, INTRC_IO , MCLR , NOBROWNOUT , NOLVP , NOCPD , NOWRT, NODEBUG,NOPROTECT
#use delay(clock=8000000)
void main()
{
setup_oscillator(OSC_8MHZ);
while(true){
if (input(PIN_A4)) {
output_high(PIN_B1);
output_high(PIN_B7);
}
else{
output_low(PIN_B1);
output_low(PIN_B7);
}
}
} |
|
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Apr 27, 2011 4:55 am |
|
|
It works correctly with recent CCS C version. If you have an old version, check the actual fuse settings in MPLAB. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Wed Apr 27, 2011 5:30 am |
|
|
ALSO be sure to set the MPLAB Project ,'build configuration' to 'release' from 'debug' , recompile (F10), then burn the PIC with that code. |
|
|
ebalvis
Joined: 27 Apr 2011 Posts: 2 Location: Spain
|
Problem solved. |
Posted: Wed Apr 27, 2011 4:23 pm |
|
|
Project-> Build configuration-> release. Rebuild.
Thank you very much. |
|
|
|