Mistake in my code?

Discussion in 'Programmer's Corner' started by mickyt1989, Jun 12, 2013.

  1. mickyt1989

    Thread Starter New Member

    Jun 12, 2013
    Hello there I am trying to program my PIC16F877 to recieve data from a rotary sensor. I am looking to create code for an ADC and send it out through a serial port to PuTTY. It will compile ok but I am just not getting the signal out.

    Here is my code. Where am I going wrong?
  2. mitko89


    Sep 20, 2012
    Are you sure this one works? I saw few typos.
  3. Andreas

    Active Member

    Jan 26, 2009
    I agree. Looks like some obvious syntax errors to start with. Go through it line by line and dbl check.
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    It would be best if you posted your schematic. Could you also write some words on how you connected your PC to the Micro. What kind of USB dongle do you use?
    What have you done to debug this? And are you familiar with debugging at all. I do not know why. But many beginners are VERY reluctant to learn debugging. But the debugger is your best friend in programming. If your programmer do not support in circuit debugging for your chip. You can also trap a lot of errors with simulator in MPLAB. Are you using MPLABX or MPLAB? If you are on a windows platform. I would have used MPLAB and not MPLABX