Effect of DT_INT14 on Serin2 or DebugIn


Closed Thread
Results 1 to 7 of 7
  1. #1

    Default Effect of DT_INT14 on Serin2 or DebugIn

    Lets assume I have 9600,8,N,1 data packets comming in via the USART HSERIN and am using DT_INT to collect that data to a buffer. I have no control over the incoming data stream and we can't miss any.

    Now assume I also want to recieve and or transmit less critcal data on another pin using SerIn2 / Serout2 or Debug In/Out.

    What will happen to data comming in via serin2/debugin if the usart triggers an Interrupt?

    What will happen to data being transmitted via Serout2 or debug out if the usart triggers an interrupt?

    Will it jump out of the serin2/debug in and return into it correctly or will it retun to the next command.

    I could disable interrupts when using Serin2/Debug In but don't really want to do this.

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


    Did you find this post helpful? Yes | No

    Default Re: Effect of DT_INT14 on Serin2 or DebugIn

    Hi,
    What will happen to data comming in via serin2/debugin if the usart triggers an Interrupt?
    Depending on the oscillator speed, how tight your ISR is and the baudrate of the incomming data captured with SERIN2/DEBUGIN you may or may not be able to capture the data properly, hard to say for sure...

    What will happen to data being transmitted via Serout2 or debug out if the usart triggers an interrupt?
    Same thing, the SEROUT2 command will get interrupted and thus its timing will be messed up possibly too much for the receiver to capture properly. Again, it MIGHT work depending on execution speed, baudrate etc but I can not say.

    Will it jump out of the serin2/debug in and return into it correctly or will it retun to the next command.
    It will jump out of the command and then back into the command (not to next command (if it wasn't finished)) as if nothing happend. However, the time spent in the ISR will be "lost" so the timing for the bitbanged commands will be off by that amount which may or may not present a problem depending on things outlined earlier.

    /Henrik.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Effect of DT_INT14 on Serin2 or DebugIn

    Well my osc is 8mhz and data on serin2 or debug will be 10400,8,N,1 worst case scenario.

    Hserin will be interupting every byte but only to move the data to the buffer. Have to see what happens.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Effect of DT_INT14 on Serin2 or DebugIn

    Just resurrecting this. I'm using an 18F2620/80 chip.

    Let's assume I must use serin2 and serout2 for some serial stuff so can't use DT interrupts to create a timer.

    How can I implement a 100ms or 1S tick timer with the above restriction?

  5. #5
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Effect of DT_INT14 on Serin2 or DebugIn

    • ...so can't use DT interrupts to create a timer.


    I guess this is a good place to start. Why not? You can use DT_INTs with every single Interrupt your PIC is capable, and all at the same time. You can have a Timer Interrupt and also multiple UART Interrupt Handlers, all with DT_INTs.

    If you haven't already, read the book a few members assembled as a tutorial on DT_INTs:

    http://dt.picbasic.co.uk/Site/Introduction

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Effect of DT_INT14 on Serin2 or DebugIn

    My understanding is Interrupts interrupt software based serial routines like Serin2 and break them..
    Have I missed something? I can't use hardware serial in this application due to pinout constraints.

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: Effect of DT_INT14 on Serin2 or DebugIn

    My understanding is Interrupts interrupt software based serial routines like Serin2 and break them..
    Have I missed something? I can't use hardware serial in this application due to pinout constraints
    no , thats pretty right any software timed function is compromised

    if you use an asm timer interrupt to set a flag to be processed in main code when needed and your serial baud rate is not too high
    you may get away with it. i would use define int rather than dt ints to minimise overheads

    another option is to disable the int when serial transactions are being carried out

    better still use a modern chip like k42 series with peripheral pin management , nearly any pin can be any function
    and they have 2 esuarts

    this ticker , what sort of range does it need , i tend to use a 4mS timer counting a 16 bit counter , allows me to measure
    65535x4mS periods a 4 minute-ish rollover
    Warning I'm not a teacher

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