i was not able to generate the hex code i compile the program using the command sdcc -mpic14 -p16f84a -c example.c.but i have n't get the hex code .plz tell me how i can get the hex code

On 12/20/06, Raphael Neider <rneider@web.de> wrote:

>       i am using sdcc for programing pic16f84a .i am fresher in
> sdcc .now i had aproblem .i want to read data from a single pin in the
> porta and also i want to sent other pin as output(pa0 as input and
> pa1-pa3 as output).plz send me a code to do this ,help me in solving
> this problem.

Ever bothered to skim through include/pic/pic16f84a.h and/or the
pic16f84a datasheet?

<code name=" ports.c">
#include <pic14regs.h> // may also use pic16f84a.h directly

typedef unsigned char u8;

u8 foo(u8 val) {
  TRISA = 0x01; // RA0 is input, RA1-RA4 are outputs
  PORTA = val;
  RA1 = 1;
  RA2 = 0;
  return (RA0):

sdcc -mpic14 -p16f84a -c ports.c


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
Sdcc-user mailing list