anyone know what to do for external i/p or o/p v3board

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

Post Reply
phatali
Posts: 10
Joined: Sun Nov 19, 2006 12:57 am
Contact:

anyone know what to do for external i/p or o/p v3board

Post by phatali »

hi
im new to programming and have just got a v3 board. im trying to attach an external switch on port A. i have some code that if i press sw4 on portA rb0 is activated and also a display on the lcd screen, but now i want an external switch to do this, anyone know what code is needed to allow me to do this. by the way at the moment im using a PIC16f88.

thnks in advance :D

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

Post by Benj »

You should be able to keep your code the same and just change the hardware to allow for the external switch. If you wire up your external switch as follows then the external switch will behaive like the switch on the board.

RA4---Switch---300R---+V

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

You can attach Ben's circuit to the RA4 screw terminal on the left side of the development board.

If you plan to use a switch in your own circuit (i.e. not using the dev board), then you will also need to provide a path to 0V for when the switch is not pressed (e.g. a 47k resistor between RA4 and ground).

phatali
Posts: 10
Joined: Sun Nov 19, 2006 12:57 am
Contact:

Post by phatali »

thanks guys for the help, i shall have to try these out :D
cheers !

Post Reply