PIC 18F25K80 RB0

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Glesto
Posts: 2
Joined: Fri Nov 07, 2014 8:58 am
Been thanked: 1 time
Contact:

PIC 18F25K80 RB0

Postby Glesto » Fri Nov 07, 2014 9:19 am

I'm trying to program the pic18f25k80 with a pickit 2.

I am trying to make pin RB0 high with this simple code:

// --------------------------------------------------------------------------------------------------------------------------------
#include <18F25K80.h>
#device adc=12

#FUSES NOWDT //No Watch Dog Timer
#FUSES SOSC_DIG //Digital mode, I/O port functionality of RC0 and RC1
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES HSH //High speed Osc, high power 16MHz-25MHz
#FUSES NOPLLEN //4X HW PLL disabled, 4X PLL enabled in software
#FUSES NOBROWNOUT //No brownout reset

#use delay(clock=20000000)
#use rs232(baud=19200,parity=N,UART1,bits=8,stream=PORT1) // reserved space

// --------------------------------------------------------------------------------------------------------------------------------
void main()
{
while(true)
{
output_high(PIN_B0);
}
}

But if I check the voltage between RB0 and the ground I get nothing, the 5V is still between my vss and vdd.

Does someone know what I could change? because I get no errors in the pic-c compiler.

Thanks in regard

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4145 times
Contact:

Re: PIC 18F25K80 RB0

Postby Benj » Fri Nov 07, 2014 12:58 pm

Hello,

Is the MCLR pin connected to 5V using a resistor?

Might help to see a schematic of your setup.

Can't really comment on the syntax of the code as I have not used the compiler your using.

Glesto
Posts: 2
Joined: Fri Nov 07, 2014 8:58 am
Been thanked: 1 time
Contact:

Re: PIC 18F25K80 RB0

Postby Glesto » Tue Nov 11, 2014 4:18 pm

Thx, that was indeed the problem.
Everything works fine now.
These users thanked the author Glesto for the post:
Benj (Wed Nov 12, 2014 12:41 pm)
Rating: 5.26%