Setting latx instead of portx before trisx


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Dec 2014
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Setting latx instead of portx before trisx

    Thanks Henrik.
    Of cource it should be %00000000 to set as outputs, hjärnsläpp.
    I do like below @ 64mHz, but no capcitive load, and all A/Ds is off. I'll just use latx.
    porta.0 = 1
    porta.1 = 1
    porta.2 = 1
    porta.3 = 1

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Setting latx instead of portx before trisx

    Hi Matias,
    Yes, when you do things like that
    Code:
    porta.0 = 1
    porta.1 = 1
    porta.2 = 1
    porta.3 = 1
    Running at high speed can cause RMW issues. What happens is that for each "bit-flip" the port is read, bit is flipped, port is being written.
    Because the "limited" current capability of the output driver the voltage at the output doesn't rise instanously. So when PORTA.1=1 executes and the port is read the voltage at PORTA.0 hasn't reached a voltage above the threshold for a logic high so when the port is written back after flipping bit 1 bit 0 will be re-written as 0.

    /Henrik.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: Setting latx instead of portx before trisx

    So the recommendation is not to do consecutively bit operation but one port write.

    for example:
    Code:
    temp=porta
    temp=temp & $FF
    porta=temp
    Ioannis

Similar Threads

  1. USBBufferSize setting
    By Ronald123 in forum USB
    Replies: 4
    Last Post: - 18th April 2008, 12:33
  2. Setting up the oscillator
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd October 2007, 14:53
  3. Setting a pin twice
    By RUBiksCUbe in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th September 2006, 01:45
  4. Setting up ADC....
    By robertmark68 in forum General
    Replies: 1
    Last Post: - 11th August 2006, 18:08
  5. setting register
    By volcane in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th April 2006, 22:46

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