How long does this take to execute


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Posts
    98


    Did you find this post helpful? Yes | No

    Default Re: How long does this take to execute

    thanks for that BREAK idea tumbleweed

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


    Did you find this post helpful? Yes | No

    Default Re: How long does this take to execute

    I have a feeling that this project is on the limit of the 18F series chips with PBP.
    Eventually you may need to do a lot in assembly or finally select a 24F chip and C compiler...
    If they could do this in the early 90's then we sure as hell should be able to do it now, with PICs running PBP code at 64MHz, DT-Ints or no DT-Ints.....

    I really have not seen the spec's of the DMX512. Is it necessary to send data continually?
    The specification really only says 1 frame per second minimum but that obviously won't work in practice.

    Note that if you're using a pic uart to send data you'll have to generate the second stop bit using a delay of 4us between bytes, but that's not normally a problem.
    Not sure about that, may depend on the PIC used but at least the 25K22 family supports 9bit transmission, the 9th bit normally being used for parity. Simply enable 9bit transmission and keep the 9th bit at a logic '1' and you'll have your second stop bit.

    For the transmitter I found it easier to generate the DMX BREAK signal using an extra IO pin.
    Good idea, however I'd just disable the UART for the duration of the BREAK period, this drives the output pin to whatever state the LAT register dictates. Equally simple but saves an output pin.

    use two 512 byte packets... one for the main loop to fill (#1) and one for the ISR to transmit (#2).
    Using a double buffer may have its merits but since each channel is a single byte I don't really see the need for it. Is there REALLY a need to keep all channels in sync within 25ms or even less?
    Perhaps some special type of fixtures/lamps/whatever uses TWO channels combined to get a 16bit value in which case you COULD potentially change one byte of that value while the other one is being sent but then again, if the update rate is >40Hz, will anyone even notice?

    Nah, based on the tests I made, running a PIC at 64MHz should allow you to keep up with the theoretical maximum framerate - even WITH DT-Ints.

    /Henrik.

  3. #3
    Join Date
    Aug 2011
    Posts
    459


    Did you find this post helpful? Yes | No

    Default Re: How long does this take to execute

    Simply enable 9bit transmission and keep the 9th bit at a logic '1' and you'll have your second stop bit
    Now that's a slick idea! I'll have to remember than one.

Similar Threads

  1. Unable to execute mpasmwin
    By oldmainframer in forum General
    Replies: 3
    Last Post: - 18th December 2016, 00:01
  2. Interrupt won't execute.
    By bison_bloke in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 26th March 2010, 16:46
  3. Replies: 5
    Last Post: - 24th February 2009, 19:55
  4. Proteus Execute Error
    By pramarn in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th October 2006, 09:51
  5. SEROUT2 takes 1400ms to execute?
    By droptail in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th March 2006, 18:08

Members who have read this thread : 1

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