strange problem ! pic18f4550 & pic16f84a serial communication .


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Jul 2016
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: strange problem ! pic18f4550 & pic16f84a serial communication .

    Hi
    thanks Richard , my code as below
    Code:
    define osc 48
    TRISB = $00 ' Set digit pins to output 
    mainloop:
    toggle portB.5 
    pause 200 
    Goto mainloop ' Forever
    
    End

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,690


    Did you find this post helpful? Yes | No

    Default Re: strange problem ! pic18f4550 & pic16f84a serial communication .

    your not paying attention the solution has already been offered , and for an issue like this its important to include the config section
    config + program are inseparable for diagnosing this problem

    Code:
    define osc 48
    TRISB = $00 ' Set digit pins to output 
    mainloop:
    toggle portB.5 
    pause 200 
    Goto mainloop ' Forever
    
    End
    RTFM

    ;wrong define osc 48 DEFINES ARE CASE SENSITIVE
    define OSC 48


    Warning I'm not a teacher

  3. #3
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: strange problem ! pic18f4550 & pic16f84a serial communication .

    Just testing, as sometimes I've noticed that when pasting code copied from MCS into the forum, it sometimes re-formats it and changes upper to lower case

    Just ignore this

    Code:
    DEFINE  OSC 20                          ' 18F4520, 20mhz crystal
    Edit: - seems to work fine so it's not that, so must be human error ;-)

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: strange problem ! pic18f4550 & pic16f84a serial communication .

    In MCS keywords are reformatted on the fly - but for display purposes only. The case in which you type it in is what's stored in the actual file. If you typ HsERiN that's what stored when you save the file even if MCS displays HSERIN on the screen.

    define is a keyword so when you type that in MCS it gets reformatted to upper case (if you have your formatting setup that way) but if you then copy/paste that into Notepad or whatever it reverts to the way you typed it (which can be DefINe or whatever). OSC on the other hand - which is the important thing here - is NOT a keyword that MCS recognizes so it does NOT get reformatted and that's a good thing in this case because if it did you'd see OSC on the screen even if you typed it as osc which would then cause the assembler to not recognize it as OSC.

    /Henrik.

Similar Threads

  1. Serial Communication Using PIC16F84A
    By fazan83 in forum GSM
    Replies: 9
    Last Post: - 22nd January 2007, 03:56
  2. Serial Communication Problems (Strange!!)
    By Armando Herjim in forum Serial
    Replies: 1
    Last Post: - 20th June 2006, 23:46
  3. Replies: 5
    Last Post: - 20th March 2006, 02:34
  4. Serial Communication Problem
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 23rd February 2006, 03:11
  5. Replies: 8
    Last Post: - 11th November 2004, 21:08

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts