button press AND hserout issues?!


Results 1 to 15 of 15

Threaded View

  1. #1
    Join Date
    Aug 2005
    Posts
    27

    Default button press AND hserout issues?!

    So... I dug out my ICD2 and selection of pics, to build myself a MIDI foot controller. Not having played with MIDI before, I set up a 16f628a, and tried the following:

    DEFINE HSER_TXSTA 24H
    DEFINE HSER_BAUD 31250

    main:

    [set relevant ports and CMCON, etc...]

    loop:
    hserout [144,90,90]
    goto loop

    Voila! My MIDI analyser shows note on, channel 1, regular as clockwork. Next, I need to send differing messages dependent on one of [n] push-to-make footswitches, so I tried:

    if not porta.1 then
    hserout [144,90,90]
    endif

    FAIL! Whereas the analyser was consistent before, now it fails every so often, showing error messages/system reset errors, etc., which leads me to believe there are timing issues with the USART that the if...then and porta.0 test is causing.


    I don't want to write a hserout equivalent in assembler, as that's the whole point of using PicBasic Pro, but the timing issues and the button press test are making what should have been a simple project quite frustrating...

    I feel that there's not enough documentation available which explains precisely which resources a given command uses, borne out of other frustrating isues I've had with timers, serial LCD display, etc...

    Can anybody shed any light on this, or is it back to assembler for this whole project???

    G
    Last edited by Giulio; - 29th July 2011 at 20:26. Reason: fixed one issue

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