Strange Behavior 12F1822


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: Strange Behavior 12F1822

    "When i'm using 16MHz internal frequency (OSCCON = 01111000) everthing works fine."

    You thought everything worked fine.

    I see no DEFINE OSC 16 or 32.

    "My programm does software-pwm, lighting 5 LED's up and down."

    May I suggest that you use DT's MIBAM for these 5-LEDS ?
    With 32Mhz, you can get high refresh rate with MIBAM.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Strange Behavior 12F1822

    nobner, that is in this line of code?
    OSCCON = 110000

    Apparently when copying text It did not allow the correct sequence to be copied. Look at the embeded code sequence at the line where you are setting OSCCON.
    Last edited by Dave; - 31st January 2012 at 12:43. Reason: copy and paste not working...
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: Strange Behavior 12F1822

    Quote Originally Posted by Dave View Post
    nobner, that is in this line of code?
    OSCCON = 110000

    Apparently when copying text It did not allow the correct sequence to be copied. Look at the embeded code sequence at the line where you are setting OSCCON.
    It is something with the system here. Sometimes percent sign, %, disappears in code block.

    Norbert has it correct in code block.

    I guess it will be fixed soon.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default Re: Strange Behavior 12F1822

    Hi,

    This sounds like the classic RMW issue.
    Instead of aliasing your LEDn variables to the PORTA register, try alias them to the LATA register and see what happens.
    Do a search for read modify write if you don't know what RMW means.

    /Henrik.

  5. #5
    Join Date
    Jan 2009
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: Strange Behavior 12F1822

    Hello,
    did a wrong measurement yesterday.
    Only Ports RA0 and RA2 have the spikes.
    All other ports are working correct at 16MHz and 32MHz.
    I added DEFINE OSC 32 - nothing changed.
    I replaced the aliases for the LED with direct ports in the programm (PORTA.0=1) - nothing changed.
    Now i'll search for RMW as recommended.

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


    Did you find this post helpful? Yes | No

    Default Re: Strange Behavior 12F1822

    Hi,
    Replacing the alias with direct port adress doesn't make any difference. What I suggested was to write to the LAT register instead of the PORT register, ie:
    LATA.0=1 instead of PORTA.0=1
    or created the alias pointing on the LAT register instead of the PORT regsiter:
    LED1 VAR LATA.0 instead of LED1 VAR PORTA.0

  7. #7
    Join Date
    Jan 2009
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: Strange Behavior 12F1822

    Hi Henrik,
    thank you for your great help, writing the LAT register did the job. Signals are perfect now.
    I also found now a second solution for the problem - using the "high porta.0" and "low porta.0" works also.
    Thank you very much,
    best regards
    Norbert

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