Menu

USB project

Help
fisyon
2015-11-09
2015-11-09
  • fisyon

    fisyon - 2015-11-09

    hi,
    i want to build a circuit that can send data to the pc or can get data from the pc over usb. also i want it to work standalone.
    i bought pic18f4550 for this purpose. i can program it for standalone projects but i don't know how and where to start for usb communication.
    i have
    a k182 clone programmer
    a 18f4550 pic micro
    a pc with visual basic 5 installed

    what i need to do step by step?

     
  • Anobium

    Anobium - 2015-11-09

    Sorry, the current focus is to release the next release of Great Cow Basic. The next release of Great Cow Basic is a stable platform for the future.

    Regarding the USB driver. We have two streams of work. One Microchip and one ATMEL. Both have some working capabilities in terms of communications etc. Both streams need further work to complete the USB driver and testing.

    Providing USB driver capability is one the high priority list for completion after the release.

     
  • David Stephenson

    I recently bought a few FT201X chips which were quite cheap (£1.51 from RS). Despite the extreme complexity of the datasheet it turns out to be quite easy to send data from a microprocessor to a computer using USB. Here's the code on the PIC12F1552

    sub ft201 'send to USB port
    Hi2cstart
    hi2csend(0x44) 'write
    HI2Csend(temp1+48)
    HI2Csend(temp2+48)
    HI2Csend(46) 'decimal point
    HI2Csend(temp3+48)
    HI2Csend(32) 'space
    HI2Csend(248) 'degree
    HI2Csend(67) 'C
    hi2cstop
    end sub
    

    It is sending a temperature reading Temp1 Temp2.Temp3 followed by space and degrees C.
    The data on the computer can be accessed via a virtual COM port (it's COM4 on my computer).
    I've used QB64 to read the COM port (but any terminal program should work I suppose).
    Here's the QB64 code

    SCREEN _NEWIMAGE(400, 200, 2)
    font1& = _LOADFONT("c:\windows\fonts\times.ttf", 40, "bold")
    _FONT font1&
    
    DIM a AS STRING * 8
    OPEN "com4:9600,N,8,1,CS0,DS0" FOR RANDOM AS #1 LEN = 8
    DO
        WHILE LOC(1) < 8: WEND
        GET #1, , a
        _PRINTSTRING (50, 10), a
    LOOP
    CLOSE #1
    END
    

    Just to show it works here is a screen shot.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.