Better Documentation?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    At least you're not lazy and you're not afraid to work hard. So, don't give up dude.

    Yup the timer interrupt is the way to go with UsbService. Make sure you set the interval each 100uSec or so.... yeah i know it's written 10-20 mSec in the manual.

    Yes anything else may screw up the USBservice if it takes to much time to execute. As i don't see your code, i can't comment.

    You could remove the external pull-up and enable the internal one, look at the UCFG register.

    You MUST change... DEFINE OSC 20 to DEFINE OSC 48 or all your timing will be screwed up.

    Mecanique EasyHID always worked a treat for me... too bad...

    USB is not as simple as RS232, sure one day i'll have to take my time and read carefully the whole Jan Axelson bible. 'Till now none of my stuff needed the full speed and Timing accuracy, so EasyHid and those 3 PBP command work really well.

    It's like everything new stuff, you must learn by trial/error. To me, it's the best way... even if some keyboard, mouse or everything close to my hands, fly here and there

    In case you didn't already, have a look at the following
    http://www.picbasic.co.uk/forum/showthread.php?t=5418

    Don't give up!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Aug 2005
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    Hey, thanks for the encouraging words!

    I FEEL lazy but, when I'm up at 4am for the n_th night in a row, I guess I'm either doing SOME work, or I'm obsessed ! [probably a bit of both].

    Like your project - in fact I'm ordering a 18F4550 right now, so I can try it. I could convert parts of it I suppose, but hey, I need an excuse to buy another chip!

    My irq code is here - don't be too hard on it ;-), I'm still playing with the numbers to see at what point it falls over.

    I haven't yet fired up the calculator or the 'scope to do any formal timing tests...

    What it does show is how superb picbasic is at allowing us to mix assembler and basic. I know I could have coded the led toggling with a couple of lines of assembler but I had great fun just dropping in and out of inline code type mixing [if that makes sense].

    Onwards and upwards... [or, in my case, sideways!]

    Thanks again.

    Giulio


    ;===================================
    asm
    myint
    movwf wsave ;save off relevant registers
    swapf STATUS,w
    clrf STATUS
    movwf ssave
    movf PCLATH,w
    movwf psave

    btfss PIR1,TMR1IF ;test for time1 irq
    goto T0_IRQ ;no - go test for timer0
    endasm
    toggle portc.7 ;yes - flash led [too fast at these settings...]
    USBService ;keep connection alive
    asm
    movlw .250 ;next interrupt
    movwf TMR1L ;lo
    movlw .210 ;next interrupt
    movwf TMR1H ;hi
    bcf PIR1,TMR1IF ;acknowledge timer1 interrupt
    T0_IRQ
    btfss INTCON,TMR0IF ;test for timer0 irq
    goto pull ;no - clean up

    movlw .0 ;yes set up next irq
    movwf TMR0L
    movlw .100
    movwf TMR0H
    bcf INTCON,TMR0IF
    endasm
    toggle portc.6 ;flash led
    asm

    pull ;clean up
    movf psave,w ;pull registers
    movwf PCLATH
    swapf ssave,w
    movwf STATUS
    swapf wsave,f
    swapf wsave,w
    out
    retfie ;done
    endasm
    ;===================================

Similar Threads

  1. VDIP1 (Vinculum - FTDI) problems
    By BrianT in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 20th August 2013, 14:51
  2. ISD1700 series Winbond chipcorder
    By rickeybell in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 21st March 2010, 07:13
  3. poor documentation
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th September 2007, 08:54
  4. Make me some code..
    By xobx in forum mel PIC BASIC Pro
    Replies: 40
    Last Post: - 22nd September 2007, 15:27
  5. Problem about CJ120
    By Ben_pvbj in forum Off Topic
    Replies: 2
    Last Post: - 26th May 2007, 05:42

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