SUPER BASIC C help plz

Status
Not open for further replies.

Makaram

Member
Using MPLABS 8.8, Hitech C compiler, a pic16f84a and a pickit3
all I want to do is set a pin high so I can check if my whole setup is working before I really knuckle down and learn some C.
If i simply wanted to turn my RB3 pin high so i can attach a LED to check my whole system is working, what code would i use?
thanks !
 
I have some basic C code that will do the task... I have ported Nigel's asm tutorials to C.

Just click the link in my signature and look at tutorial 1
 
I suggest you read the datasheet for the '84A. You'll need to set the fuses first, include source files, etc before even being able to start coding. You'll also need to set it up for ICSP. From there, it's simply a matter of setting TRISB to output (At least RB3) and then writing a main loop. Turning the LED on is the easy part. There's a lot you need to do before you can start with that. The datasheet is very important.

Der Strom
 
They are still called fuses..... In flash they are read / writeable... DS8 is talking about the config register it contains 'bits' (used to be fuses) that control the mode / operation of the device.

If you load tutorial 1 into MPLAB and change the second line '__config()' and change the value to 0x3ff1.. Remove the line 'CMCON0 = 7' this will revert the code to work with the 84a
 
Last edited:
He is asking...

He said: all I want to do is set a pin high.

Isn't he asking for an instruction in C to get that acomplished?

I am not C conversant.

Yes, he follows with: If i simply wanted to turn my RB3 pin high so i can attach a LED to check my whole system is working, what code would i use?
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…