USART TX Interrupt problem. (DT_INTS)


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: USART TX Interrupt problem. (DT_INTS)

    Hi,
    may need a different pointer for TX int if you are using that one for HSER also. I think they will get intertwined !?

    don

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


    Did you find this post helpful? Yes | No

    Default Re: USART TX Interrupt problem. (DT_INTS)

    Thanks don,
    I was actually trying some things with regards to your latest thread when I stumbled across this.

    You have a good point. However, I don't think different pointers will make any difference in this case. Here's the reason(s) for my statement.

    1) I have a Pause 500 after enabling the interrupt, that's more than enough to send the string out. This means that TXPointer is free to use when "test 4" begins.

    2) If that was the case then the size of the array wouldn't matter. Note that I'm not changing the amount of data actually written to the array, I just change the declared size of it. 50 works, 100 doesn't.

    3) When test 5 is executed it shows that the actuall content of the array is changed. I forgot to mention this is in first post but I initially used another pointer variable (not TXPointer) in Test5 and it gave the same result as when using TXPointer - ie, it shows that the array is corrupted.

    /Henrik.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: USART TX Interrupt problem. (DT_INTS)

    OK then,

    This puts a byte at location 50 (dec) in ram
    Code:
    String_1    VAR BYTE 50       ' Array to hold string.
    this puts array of 50 where PBasic puts it
    Code:
    String_1    VAR BYTE  [50]             ' Array to hold string.
    this puts array of 50 at location $100, (100hex, 256 dec)
    Code:
    String_1    VAR BYTE  [50]              $100     ' Array to hold string.

    At the bottom of the generated LIST file is a listing of the mem locations for ram and prog mem
    there you can see the var's location and alotted space left between arrays.

    Name:  Capture2.JPG
Views: 633
Size:  120.8 KB

    Don
    Last edited by amgen; - 16th August 2011 at 13:39.

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


    Did you find this post helpful? Yes | No

    Default Re: USART TX Interrupt problem. (DT_INTS)

    That's it, thank you!
    It was all in the declaration, I had forgot the brackets!

    Can't belive I didn't think of that - the number of times I've been there and changed the value and missed the missing brackets. Guess, since it worked with an imiginary lenght of 50 it was harder to see.

    Thanks again!

    /Henrik.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: USART TX Interrupt problem. (DT_INTS)

    that will be $1 or cup of coffee or credit for my future dumb stuff

    don

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


    Did you find this post helpful? Yes | No

    Default Re: USART TX Interrupt problem. (DT_INTS)

    Henerik, Why are you using HSEROUT when you have the interrupt all setup?
    Dave Purola,
    N8NTA
    EN82fn

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,613


    Did you find this post helpful? Yes | No

    Default Re: USART TX Interrupt problem. (DT_INTS)

    Because the interrupt messed up my array of data and the HSEROUT statements helped me show what was going on. Which turned out to be that I hadn't declared the array properly.

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