ASM equiv for SERIN2???


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257

    Default ASM equiv for SERIN2???

    Hi,

    I think I need to speed up my program by using ASM.

    Basically I have a PIC programmed as a DCE using Hardware flow control, it then prints out to a centronics printer.

    My flow control (Using DSR and CTS) from the PIC works ok but when the flow speed is increased, the PIC fails to print some characters...

    Here is a cut from the code: (CTS - Clear to Send)

    MAIN:
    HIGH CTS
    SERIN2 SDI,16780,[char]
    LOW CTS

    <... output to printer here ....>

    GOTO MAIN


    It seems that the pic is not quick enough between capturing the char and clearing the CTS signal.

    I may be able to speed things up by converting the above three lines to ASM?

    Can anybody help please?
    J

  2. #2
    Join Date
    Oct 2003
    Location
    Cyprus
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Hello Squibcakes,
    First, avoid the commands: High <pin> and LOW <pin>.
    Use CTS=1 or CTS=0 instead. The take less code space and I thing they execute faster. There is an assembly equivalent of just few lines but I do not use assemble and need to read the manual to answer this.
    Secondly, you might try the HSERIN and HSEROUT commands if your PIC has a hardware USART build-in. This might need a MAX232 IC to invert the logic.

    Regards
    K.

  3. #3
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Hi Kypros,

    Thanks for the HIGH / LOW tip...

    I've been playing around with the code some more and found that it is even better to use the FLOW pin option.. ie

    SERIN2 SDI\FLOW,16780,[char]

    and scrap the HIGH , LOW flow commands all together.

    Its possible that the PC's UART buffe is still causing me some problems and headaches....

    I may need to re wire and use the USART after all.... I will post here if I have any success.
    Squib

Similar Threads

  1. PBP, ASM and LST files
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2010, 13:43
  2. ASM help
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 21st October 2009, 03:08
  3. Serial Output - for an ASM numb
    By scomi85 in forum Serial
    Replies: 0
    Last Post: - 1st March 2009, 10:13
  4. Problem using ASM instruction
    By ewandeur in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd April 2008, 15:26
  5. Can an asm interrupt contain gosub to a picbasic routine?
    By sougata in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st April 2005, 19:49

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