Hi, guys. I'm an electronic engineering technology student in my final year. It was reccomended to me to use a PIC16F873A (which I now have) for my final project. I need a little help to get started. I've been reading many sites for the past few days and still don't know where to start.
I have some experience with both assembly and c languages. I am currenly working with mikroC and mplab ide. Would prefer to use C.
What I am trying to accomplish: read in 3 digital values from Port C (RC0, RC1, RC2) (port c because of its ST property) and based on some IF statements output a digital value on Port A (RA0).
Also: Can I assign the ports to variables to make working with my IF statements easier?
All help is greatly appreciated! If you need me to clarify anything just ask. Thanks in advance.
If you use only one equal sign, 0x01 is placed to PORTC. Using two equal signs makes it comparison operator.
So I think that should be like this: if (PORTC == 0x01) PORTB = 0xFF;
I wrote a simple little program to make all portB output a high value. Tested it in PIC simulator IDE and it works. Next I try programming/burning the chip using USB PIC PRG.
I put the chip in the breadboard and make the following connections: Vdd(Pin 20) = +5V, Vss(Pins 8,19) = Gnd, and Vpp(Pin 1) = +5V. But I am not getting any output on portB. Any ideas on what I am doing wrong?
That's because "if (a=b)" is valid and has a different meaning from "if (a==b)". Parsing a string for example: "while (c=str[i++])" will terminate when c==0.