+ Reply to Thread
Page 2 of 2
First 1 2
Results 16 to 27 of 27

Thread: UART and Hyperterminal

  1. #16
    sandeepa Newbie
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    73

    Default

    Hello everyone

    Finally its worked...my mistake all along(as is always the case)

    The configuration word had been accidently set to 3F7A instead of 0x3F7A!!! :shock: ops:

    Tried all the codes I had tried before and they all work fine.

    A missing "0x" and two days of complete frustration.
    Anyway,thanks a lot everyone esp. Pommie and Nigel Goodwin.
    Thanks


  2. #17
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,766

    Default

    Quote Originally Posted by sandeepa
    Hello everyone

    Finally its worked...my mistake all along(as is always the case)

    The configuration word had been accidently set to 3F7A instead of 0x3F7A!!! :shock: ops:

    Tried all the codes I had tried before and they all work fine.

    A missing "0x" and two days of complete frustration.
    Anyway,thanks a lot everyone esp. Pommie and Nigel Goodwin.
    Thanks
    So what was it setting your fuses as?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  3. #18
    sandeepa Newbie
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    73

    Default

    So what was it setting your fuses as?.
    The fuse settings were shown as before.
    Brown Out and Memory Write enabled and the type of oscillator as HS.

    But without any base specified for the configuration word,would it be programmed into the memory?

  4. #19
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,766

    Default

    Quote Originally Posted by sandeepa
    So what was it setting your fuses as?.
    The fuse settings were shown as before.
    Brown Out and Memory Write enabled and the type of oscillator as HS.
    Doesn't your programmer software show you what the fuses are set to?.

    BTW, why do you have memory write enabled?.


    But without any base specified for the configuration word,would it be programmed into the memory?
    I would expect it to give an error message, unless you have the default radix set as hexadecimal.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  5. #20
    sandeepa Newbie
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    73

    Default

    "BTW, why do you have memory write enabled?."
    No particular reason...it wont really cause any harm,will it?

    unless you have the default radix set as hexadecimal.
    Where is this setting done?I havent particularly done any such setting.Though I didnt get any error message regarding this.

  6. #21
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,766

    Default

    Quote Originally Posted by sandeepa
    "BTW, why do you have memory write enabled?."
    No particular reason...it wont really cause any harm,will it?
    Not as far as I know?.


    unless you have the default radix set as hexadecimal.
    Where is this setting done?I havent particularly done any such setting.Though I didnt get any error message regarding this.
    You can set it in various places, one is in the source code - see the MPASM helpfile, this will over ride any settings elsewhere. If it's not set in the source file it will use the default settings of the assembler, which you can set on radio buttons in MPASM.

    Presumably MPLAB has access to the default radix settings as well?, but I never use it.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  7. #22
    sandeepa Newbie
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    73

    Default

    The help file does say the default base is hex and the implicit base integers take that base.

    So would __config 3F7A be actually treated the same way as __config 0x3F7A?

    I hope thast not the case because the program satarted functioning correctly afre I changed the config word.

  8. #23
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,792

    Default

    Quote Originally Posted by sandeepa
    Hello everyone

    The configuration word had been accidently set to 3F7A instead of 0x3F7A!!! :shock: ops:

    Anyway,thanks a lot everyone esp. Pommie and Nigel Goodwin.
    Thanks
    Glad you finally got it working.

    The only way I can see that this could happen (3F7A instead of 0x3F7A!) and not give an error is if you turned error messages off. Is this what happened?

    Mike.

  9. #24
    sandeepa Newbie
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    73

    Default

    I had set the errorlevel to 2,to display only the errors.
    I checked again without any setting(and config 37fa),still didnt get any error messages.
    Does MPLAB certainly flag off an error for such a thing?

  10. #25
    sandeepa Newbie
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    73

    Default

    Just a update,because things are I think now making some sense.
    I tried the code that worked yesterday with __config 3F7A,i.e. without the 0x.
    And it still worked....and I almost got spooked out.

    So went back to my first post in the thread where I had posted my complete first piece of code.The config value set there is 3F79,which sets the oscillator to XT.(3F7A sets it to HS).Burned it on the chip(i.e. config set to 3F79),and things started behaving as before i.e. display after power switched off.Changed the setting to 3F7A and all was fine again.

    So the mistake really was not,not specifying the base(which makes no difference),but setting the wrong oscillator bits.(I need to set it to HS as I am using 8MHz crystal).

    JUst thought I should pt in the final update here.
    Thanks.

  11. #26
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,766

    Default

    Quote Originally Posted by sandeepa
    So the mistake really was not,not specifying the base(which makes no difference),but setting the wrong oscillator bits.(I need to set it to HS as I am using 8MHz crystal).
    That's VERY interesting!. There's no actual transition point given for switching from XT to HS, but generally 4MHz is condidered XT and 20MHz as HS - with the change 'somewhere' in between.

    Personally I've never found it to make any difference?, I've used either (by accident) with both 4MHz and 20MHz crystals - and all have always worked fine. Perhaps it's a characteristic of your particular crystal sample?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  12. #27
    sandeepa Newbie
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    73

    Default

    I too have used the options interchangably,and its worked,even where I have used the hardware modules like SPI.But its certainly not working for this one,I have checked a few.
    However,the datasheet does specify 8Mhz as HS,so I guess fair enough.
    I got the crystal fom a local vendor,dont really know what type it is.

+ Reply to Thread
Page 2 of 2
First 1 2

Tags for this Thread