cannot find the reason for such a strange behavior


Results 1 to 18 of 18

Threaded View

  1. #10
    Join Date
    Jun 2016
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: cannot find the reason for such a strange behavior

    Today I have finaly found the time to implement the corrections to my code!

    I have corrected the number of bytes int the array Pulse from 75 to 80. Next I have changed the following two lines of code:

    Code:
    DMY = W0//256
    Pulse[75] = (255 - DMY)
    with the simple form suggested by Richard

    Code:
    Pulse[75] = ~W0

    Compiled (22Kb of code) and updated the mcu. Power up and checked the packet transmitted via esp NOOOO! CRC is still txed as 253 all the time!

    I did change the code again setting Pulse[75] = 123 (costant value) and re-checked. Well this time CRC was txed as 123! This proved that there is no byte corruption in the code, but the problem should be in setting the byte variable Pulse[75].

    So I did change the setting of Pulse[75] = 123 to Pulse[75] = W0.lowbyte. Re-checked and it worked! CRC was txed correctly!

    Hence I added : Pulse[75] = ~ Pulse[75] (inverting bits) and CRC was still txed as 253!!!!

    I have removed Pulse[75] = ~ Pulse[75] and kept the CRC as the low byte of the packet sum that works!

    But as I stated in this thread title: "I cannot find the reason for such a strange behavior"

    Alberto
    Last edited by Alberto; - 8th November 2016 at 15:49.

Similar Threads

  1. Strange behavior on PORTB on a PIC18F26K20
    By Dosbomber in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th September 2016, 00:31
  2. Strange Behavior 12F1822
    By nobner in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 3rd February 2012, 09:11
  3. Strange LCD Behavior
    By chips123 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st November 2009, 01:48
  4. Strange behavior - PORTG.2, 18F8720
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th January 2009, 00:30
  5. Strange electrical behavior with PIC16F684
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 28th March 2008, 07:58

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