USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Hehe, but.. will your PicProgrammer be able to program it ?

    First, i wanted to post it in the USB section... But, Code Examples have to be post in the right section...

    Hope you may use some part of it one day.

    Bear in mind it's only a Demo and a 1-2 hours job.. yeah i count the beer, coffe and cigarette breaks, but remove those phone calls i got when doing it... always like that when you don't want to be disturbed
    Last edited by mister_e; - 2nd January 2007 at 00:43.
    Steve

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

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Mister_E,

    I fart in your general direction ....

    This is all your fault. I've been totally cosumed by this USB stuff for several days now. I've been so affraid of USB for so long. But after your example showed how easy it is, I've been locked in a never ending cycle of, "hmm, what else can I do with it".

    Consequently, I've accomplished nothing else, "including going to work yesterday"

    I haven't answered your ASM question in the other thread (or anyone elses), I haven't eaten much, and Sleep is a requirement that I would have rather done without (wish I could).

    I'd like to say "Thank you for the great example", but it's ruining my life.

    So instead I'll say ...
    Thanks for the Mean, Vicious, Natsy, Brutal, Sadistic, yet Wonderfull piece's of code.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Wink

    Disclaimer

    Mister E assume no responsibility for any addictions caused by the use of this actual thread, program, tutorial...
    call it as you want.

    Mister E don't want to be involve in any of your future or actual health, job and/or girlfriend/wife/boyfriend problem!
    So use with care.

    You read it, you use it... it's your problem what's happen next.

    LMAO!
    \_________________________________________________ ________________________________________________/

    <table><tr><td></td><td>Well Darrel i'm really sorry (yeah right), but at the same time... i'm proud of me. At least you lost this USB fear! And i think, for once, i teached you something... ???

    You know, I already said to few user here and there that PIC are addictive... i thought you took the advice... seems not... so
    TOO BAD FOR YOU !
    </td></tr></table>

    Now, go to sleep, eat and go back to work
    Last edited by mister_e; - 10th January 2007 at 05:09.
    Steve

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

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Mister_E,

    I fart in your general direction ....

    This is all your fault. I've been totally cosumed by this USB stuff for several days now. I've been so affraid of USB for so long. But after your example showed how easy it is, I've been locked in a never ending cycle of, "hmm, what else can I do with it".

    Consequently, I've accomplished nothing else, "including going to work yesterday"

    I'd like to say "Thank you for the great example", but it's ruining my life.

    So instead I'll say ...
    Thanks for the Mean, Vicious, Natsy, Brutal, Sadistic, yet Wonderfull piece's of code.
    <br>
    No kidding! I'm looking forward to reducing my sanity, food intake, sleepy time, and probably the wife soon after my 18F4550's arrive. So, if mister_e gets a call in the middle of the night from a screamin' female who he doesn't know, this thread is most definetly the reason why.
    I wonder how long it'll take before he's on the 'Jerry Springer' show as the unseen homewrecker.

    Thanks a lot...
    May the demons of evil get confused on their way to your doorstep!

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


    Did you find this post helpful? Yes | No

    Talking

    So, if mister_e gets a call in the middle of the night from a screamin' female who he doesn't know, this thread is most definetly the reason why.
    No problem then, my phone number is not hidden anyway... But, LOL, maybe she will have to repeat few times and be patient when i will try to reply to her... yeah my english writing is bad... imagine how bad i talk
    Steve

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

  6. #6
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Smile

    mister_ed, you are my idol

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


    Did you find this post helpful? Yes | No

    Default

    Hi Steve,

    I'm revisting USB again and using parts of the demo as a bit of a refresher

    Im writing a program where I want to send half a dozen NMEA strings (of varrying string length) which are stored in their own array, to the pc running hyperterminal.

    I can send them successfully via USB using 6 separate DoUSBOut subroutines (without the SendUSB macro array code) but I want to trim my code down and use one (1) DoUSBOut routine to do the lot.

    ->>> I kinda have it working but the received data into hyperterminal appear as though some strings aren't received or are being over written or something.

    I've modified the SendUSB macro array so that the USBBufferOut should just keep filling up according to my USBBufferCount (array size) and suspect this is the problem but I'm rusty on ASM. Perhaps the USBBufferOut needs to be "erased" after each visit to DoUSBOut? How would I do that?

    I'm going blind looking at this code and wonder if you could see any traps I may have fallen into...

    Code:
    USBBufferCount     Var Byte        '
    USBBufferOut        Var Byte[50]  ' store outgoing USB data ...... this value originally [8]
    
    GPZDA VAR BYTE[28]
    GPGLL VAR BYTE[41]
    GPGGA VAR BYTE[49]
    GPVTG VAR BYTE[27]
    
    '...... arrays get filled up here.........
    '...... other code........
    
    asm 
    SendUSB macro array
        ;   Use to Copy an specific array to USBBufferOut AND send it
        ;   to USB bus
        variable i=0
        
        ;while i<8                           ' ...............original line here........
        
        while i<_USBBufferCount
            MOVE?BB (array+i),(_USBBufferOut+i)
    i+=1
        endw
        
        L?CALL _DoUSBOut
        endm
    endasm
    
    
    USBBufferCount = 28
    @   SendUSB _GPZDA
     
    USBBufferCount = 41
    @   SendUSB _GPGLL
               
    USBBufferCount = 49
    @   SendUSB _GPGGA
    
    USBBufferCount = 27
    @   SendUSB _GPVTG 
    
    
    DoUSBOut:
        '
        '   Send data to the USB bus & Wait for USB interface to attach                         
        '   ===========================================================
        T1CON.0 = 0                                     ' TURN OFF TIMER 
        
        WaitPC:                                         '
          USBService                                      ' keep connection alive
          USBOut 3, USBBufferOut, USBBufferCount, Waitpc  ' if bus available, transmit data                                  
        
        T1CON.0 = 1                                     ' Re-Enable TMR0 interrupt  
        return
    Last edited by Squibcakes; - 17th October 2007 at 07:30. Reason: Other thoughts....

  8. #8


    Did you find this post helpful? Yes | No

    Default Where did EasyHID go?

    Hi.. i can´t find EasyHid at mecanique webpage, is it gone? how do you get it now? did it became part of some package?

    Thanks

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 10:38
  3. Replies: 9
    Last Post: - 31st July 2008, 08:56
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 3

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts