Connect with us

16F819 to 16F877

Discussion in 'Electronic Basics' started by [email protected], Dec 21, 2004.

Scroll to continue with content
  1. Guest

    I would like to convert the following codes, so it works on 16F877.

    Before converted:

    'Set up the IR HPWM modulation frequency

    Device = 16F819
    XTAL = 4

    Symbol SER_DATA = PORTB.1
    Symbol MODULATE = PORTB.2

    DelayMS 500 'Wait for the PICmicro to stabilise
    ALL_DIGITAL = True 'Enable PORTA as all digital

    TRISB.2 = 0 'CCP1 (PortB.2 = Output)
    PR2 = 25 'Set PWM Period for approximately 38KHz
    CCPR1L = 13 'Set PWM Duty-Cycle to 50%
    CCP1CON = %00001100 'Mode select = PWM
    T2CON = %00000100 'Timer2 ON + 1:1 prescale

    After converted:

    Device = 16F877
    XTAL = 4

    Symbol SER_DATA = PORTC.4
    Symbol MODULATE = PORTC.2

    DelayMS 500
    ALL_DIGITAL = True

    TRISC.2 = 0
    PR2 = 25
    CCPR1L = 13
    CCP1CON = %00001100
    T2CON = %00000100

    The converted one that I did does not work.
    Could you help me make it work?
    Thank you.

    Indra
     
  2. Externet

    Externet Guest

    Hi.
    You are at the wrong forum. This is electronics.
    Miguel
     
  3. PicMan

    PicMan Guest

    Give the guy a break...it's not like PIC's are made of chocolate!

    Sorry I couldn't help ya Indra. I'd certainly review the Spec Pages on the
    877 to see what the differences are. Also...keep an eye on the fact that
    you are using a different port on the 877 than you were on the 819. Check
    that the tris command is still legitimate and such.

    swift
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-