FREQOUT compiler error on USB Pic


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Well, since the buffer is set up as a bunch of bytes....
    You might...just might, be able to split those 'larger' values, WORDS as they're called (2 bytes, highbyte and lowbyte), and place them into the buffer back to back. And retrieve them in reverse order.
    Ohh, so you have a number you save in a WORD, and then split you the WORD up in two BYTES and then you send the BYTES, but can i then get them to one number again in visual basic? And can you also do it the other way, so i have a number higher than 255 would like to have send to the PIC?

    I Hope you can help me, and it would be great if you could make som code examples

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mindthomas View Post
    Ohh, so you have a number you save in a WORD, and then split you the WORD up in two BYTES and then you send the BYTES, but can i then get them to one number again in visual basic? And can you also do it the other way, so i have a number higher than 255 would like to have send to the PIC?
    I Hope you can help me, and it would be great if you could make som code examples
    Read the book...again...search the forums. There's plenty of info out there, more than enough.

  3. #3
    Join Date
    Mar 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Read the book...again...search the forums. There's plenty of info out there, more than enough.
    I have found out... Your code was perfect, i could also just have looked in the book

    Then i used your code in the PIC and this code in Visual Basic
    Code:
    Function LOBYTE(ByVal w As Integer) As Byte
        LOBYTE = w And &HFF
    End Function
    
    Function HIBYTE(ByVal w As Integer) As Byte
        HIBYTE = (w And &HFF00&) \ 256
    End Function
    Just so others can see it, if they maybe need it!

Similar Threads

  1. USB CDC Communications for Dummies!
    By Squibcakes in forum USB
    Replies: 104
    Last Post: - 15th January 2014, 13:43
  2. need help! to beginner
    By emilhs in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 6th May 2009, 18:44
  3. Reading a slave USB with a pic
    By pcaccia in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th October 2008, 12:00
  4. Replies: 15
    Last Post: - 30th October 2007, 19:25
  5. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 17:39

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