PIC18F2550 USB HID Oscilloscope

March 27, 2006

This is a project that I’ve been planning on putting together for a long time. After creating an oscilloscope using a PIC12F675, I wanted to create a simple and effective USB oscilloscope using the higher performance PIC18F2550. During the development of this project, I learned quite a bit about USB HID communication, which allows me to quickly and effectively communicate with the desktop computer. Using HID means that this oscilloscope does not require drivers (only the oscilloscope software).

Full Circuit

The source and firmware for the circuit can be found at the bottom of the page. Each section of the circuit is labeled in the schematic. All of the sections and their components are described and discussed below. The part numbers for the components are linked to websites for data and more information when available.

Analog Input

The analog input for the oscilloscope is connected to the A0 pin, which is configured to be an analog input. Please note that “The source impedance affects the offset voltage at the analog input (due to pin leakage current). The maximum recommended impedance for analog sources is 2.5 kΩ” (PIC18F2550, pp. 260).

Microcontroller

The microcontroller used is a Microchip PIC18F2550. I modified the PIC18F2550 Tiny PIC Bootloader assembly file so I could use a 20MHz crystal/resonator at 115,200 baud (the modified bootloader can be found at the bottom of the page). The PIC18F2550 runs at 48MHz using the internal PLL. R1 is a pull-up resistor necessary for operation. C1 is a stabilizing capacitor that is used for the onboard USB voltage regulator, which is used in this project. The component marked ‘RES’ is a 20MHz resonator.

RS232 Level Converter

The microcontroller USART pins need to be connected to a RS-232 Level Converter to connect to a PC for firmware updates using the Tiny PIC Bootloader. Otherwise, after initial programming they can be left disconnected.

USB I/O

The PIC is connected to the computer through a USB port and is bus-powered.

Source and Firmware

The PIC must initially programmed with the ‘SAC_tinybld18F2550usb _20MHz_115200_48MHz’ hex file to program the bootloader on the PIC. Then, using Tiny PIC Bootloader, the hex file can be placed on the chip using the Tiny PIC Bootloader frontend with ’12h 34h 56h 78h 90h’ in the ‘List of codes to send first:’ in the ‘Options’ menu. Please feel free to contact me if you have any problems.
- SAC_tinybld18F2550usb_20MHz_115200_48MHz.hex
- 18F2550 USB HID CRC Oscilloscope.c (hex)
- usb_desc_hid 8-byte.h
- Visual Basic example oscilloscope software with DFT: PIC18F2550 USB HID Oscilloscope DR1r1 VB Example.zip

Example Oscilloscope Images

  1. Milen
    November 23, 2006 at 2:32 AM | #1

    What is the frequency range of the scope?

  2. Milen
    November 23, 2006 at 2:33 AM | #2

    What is the frequency range of the osciloscope?

  3. November 23, 2006 at 6:22 PM | #3

    The sampling rate of the PIC18F2550 USB HID Oscilloscope is approximately 60ksps and the PIC12F675 O-scope’s sampling rate is approximately 20ksps (from what I recall). I have taken the projects apart (I usually design and make them on a breadboard), so unfortunately I don’t have them available to make quantitative measurements right now. I have combined the features of the PIC18F2550 USB HID IO with the 1 Msps (1 MHz sample rate) of the MAX114 to make a two-channel high speed oscilloscope. Although there is the potential for very high speed data acquisition, I have found that actual sampling rate has been limited by the speed of the PIC microcontroller. Although it is running at 48MHz (12MIPS), its speed storing 8 bit variables into a RAM data array with 1024 entries is quite a bit slower. However, the PIC18F2550 + MAX114 combination could reach a sampling rate of approx 200 ksps from what I remember (however, I would have to double check to make sure).

    • Avinash p
      July 18, 2014 at 8:46 PM | #4

      Hi Steve,
      I m fed up with debugging my code, which i have written for PIC18F4550 USB.
      Please send me if u have compiled code for USB. My email ID is avinashpkrishnan@gmail.com.

  4. JensaH
    December 3, 2006 at 5:37 PM | #5

    Works fine for me. Have attached a accelerometer on the A0 and the samplingrate is good enough for that. I’m trying to figure out how the heck the USB protocol works, and the idea is to make a 3 axis accelerometer “gamepad”-ish thing. Thanks for making so many cool and fun expeiments Steven!

  5. Ricky
    December 10, 2006 at 8:10 AM | #6

    Hi~ Steve,

    When I used PCWH Compiler Version 4.014 to compile your file 18F2550 USB HID CRC Oscilloscope.c & usb_desc_hid 8-byte.h, I got the following error on usb_desc_hid 8-byte.h:

    Line 156(94,95): Expression must evaluate to a constant
    Line 168 (202,203): Expression must evaluate to a constant
    Line 204 (62,105) : 41 not defined correctly
    Line 205 (113, 114) : #ENDIF with no corresponding #IF
    Line 275 (13,14) : #ENDIF with no corresponding #IF

    Would you please advise how to solve them? Thanks.

  6. December 11, 2006 at 11:47 AM | #7

    Ricky – Do you have access to PCWH 3.249? I haven’t used v4 yet because I’ve yet to hear of a strong reason to change.  I know that v4 is still quite buggy and that most of the people seriously utilizing CCS C for projects are avoiding it until all of the kinks are ironed out.  I’m guessing that the errors may be due to changes in the code structures between v3 and v4.

  7. Ricky
    December 15, 2006 at 10:39 AM | #8

    Steve – I compiled your file of 18F2550 USB HID CRC Oscilloscope.c with PCWH 3.249, but still have a error on file usb_desc_hid 8-byte.h.

    156: Expression must evaluate to a constant

    #if USB_USE_FULL_SPEED
    1,
    #else
    10,
    #endif

    Would you please advise how to solve them? Thanks

  8. Ricky
    December 18, 2006 at 8:36 AM | #9

    Steve – I can now. I added “,” after 1 and 10. Thanks.

    USB_EP1_RX_SIZE,0×00,
    #if USB_USE_FULL_SPEED
    1,
    #else
    10,

  9. abraham
    December 21, 2006 at 5:34 PM | #10

    hi steve, very interesting project
    I have some questions
    how do you measure the alternating voltage and also how do you prevent your circuit from negative part of the alternating voltage wave.

  10. Ricky
    January 2, 2007 at 3:51 AM | #11

    Happy New Year, Steve! Wish all of You and Your Family A Happy and Prosperous New Year 2007!

    As I tried to program my PIC18F2550, but the tiny bootloader can’t check my PIC, would you please help to check the connection of my PIC and RS-232 as following:

    http://rickylab.tripod.com/pic182550.pdf

    And, would you please check the following sequence of programming is correct or not:

    1) Execute Tiny Bootloader, browse “SAC_tinybld18F2550usb_20MHz_115200_48MHz.HEX”, and press “write flash”.

    2) Browse “18F2550 USB HID CRC Oscilloscope.hex”, add‘12h 34h 56h 78h 90h’ in the ‘List of codes to send first:’, then press “write flash”.

    Furthermore, would you please advise how to erase and re-flash the PIC.

    Thank you for your kindest help and sorry for asking so simple question.

  11. January 3, 2007 at 5:29 PM | #12

    abraham – Unfortunately you will need to add an offset to the signal to measure them. So, if it is a 2V peak-to-peak AC signal, then you will need to add a 1V offset. This can be done with a simple opamp circuit (such as a summing circuit or a non-inverting amplifier with offset). The main problem (which would experience) is buffering the input signal. AC voltage and high and lower DC voltages are a problem for the 0-5V PIC ADC. However, they could be accurately measured if a programmable opamp was implemented. I’m working with an individual in China to hopefully solve this problem in my future projects.

    Ricky – Happy holidays and happy new year too! I checked your setup and it looks good to me. The issue that is holding you up is that you would need to initially program the PIC18F2550 with a separate programmer. However, you can quickly and easily re-flash the PIC once you have a bootloader on the PIC. Here is the programming sequence:

    If using the bootloader:
    1) Use a dedicated PIC programmer (such as Microchip ICD2) to write “SAC_tinybld18F2550usb_20MHz_115200_48MHz.HEX” to flash.
    2) Load Tiny Bootloader, browse “18F2550 USB HID CRC Oscilloscope.hex”, add “12h 34h 56h 78h 90h” in the “List of codes to send first:”, then press “write flash”.

    I’m currently experimenting with a USB bootloader and will soon post my results. Unfortunately, if you do not have a dedicated PIC programmer, you will need to borrow a programmer to install the bootloader. Every program you write to the firmware thereafter can be done over RS-232. I’m more than happy to send a pre-programmed PIC18F2550 at cost (i.e. postage) to anyone who wants/needs one.

  12. Ricky
    January 4, 2007 at 11:57 AM | #13

    Steve – Thank you very much for your reply. I got an idea on it.
    After loaded the bootloader, is it connected like the circuit I quoted, then write to the firmware? Does it need any program or software to write it?

    I bought the LCD AGM1264F as you advised.And, I want to combine both of your great project: HID Oscilloscope and KS0108 Graphical LCD Oscilloscope, so I can use the scope indoor and outdoor. However, I have a problem on the very beginning. I found there is different ADC on the code of both program:

    #device ADC=8 (for CRC Oscilloscope)
    #device ADC=10(for KS0108 Graphical LCD Oscilloscope)

    Is it possible to same both ADC to the same?
    And, is it possible to combine both project together?

    Finally, I try to find a PIC programmer of Microchip ICD2 in my side. If I can’t find it, maybe need your help to send a pre-programmed PIC18F2550 to my side. :-)

    Thank you very much for your help.

  13. January 4, 2007 at 3:36 PM | #14

    Ricky – After the PIC is initially programmed (usually using a ZIF socket programmer or an ICSP programmer) then you should use the circuit that you posted.

    I’ve had a lot of success with the AGM1264F and it has been very easy for me to interface and program for. As I always like to say, please let me know if you have any issues and I’ll try my best to help solve them!

    As for the code at the top of the listings for the CRC Oscilloscope and the KS0108 Graphical LCD Oscilloscope, the KS0108 Graphical LCD Oscilloscope’s #device ADC can be changed from #device ADC=10. To be very honest, I’m not sure why I didn’t just use #device ADC=8 in the first place, but the code is written to take advantage of the higher resolution for the different voltage ranges. The ADC is exactly the same, but you are losing two least significant bits when #device ADC=8. Therefore, either the code for the CRC Oscilloscope needs to be modified to handle the higher resolution or the code for the KS0108 Graphical LCD Oscilloscope needs to be modified for the lower resolution. I’ve actually combined both projects haphazardly just to see if it would work and found that, with some modifications specifically with resolution and timing, it will work.

    As for the PIC programmer, the ICD2 is great but could be considered overkill. I really like its in-circuit debugging capabilities, but you can find cheaper PIC programmers and potentially make your own from plans that you can find online.

  14. Ricky
    January 7, 2007 at 8:14 PM | #15

    Steve – Unfortunately, I can’t find the prgrammer in my side, would you please send the delivery address to my email: dchuhk@hotmail.com, so I can deliver the ICs to you for programming. Since I had 3 pcs of PIC18F2550, would you please help to program 1 pc with bootloader only, 1 pc with PIC18F2550 USB HID Oscilloscope project, 1pc with KS0108 Graphical LCD Oscilloscope, so I can check my circuits correct or not.

    You are so kind, thank you for your help.

  15. VENKAT
    January 11, 2007 at 1:57 AM | #16

    I am getting errors while compiling yiur code
    18F2550 USB HID CRC Oscilloscope.c:4:Error [1027] unable to locate ’18F2550.h’
    C:Documents and SettingsAdministratorDesktopUSBPIC OSCILLOSCOPE18F2550 USB HID CRC Oscilloscope.c:22:Error [1027] unable to locate ‘pic18_usb.h’
    C:Documents and SettingsAdministratorDesktopUSBPIC OSCILLOSCOPE18F2550 USB HID CRC Oscilloscope.c:23:Error [1027] unable to locate ‘usb_desc_hid.h’
    C:Documents and SettingsAdministratorDesktopUSBPIC OSCILLOSCOPE18F2550 USB HID CRC Oscilloscope.c:24:Error [1027] unable to locate ‘usb.c’
    MPLAB C18 v3.02 (demo)
    Copyright 1999-2005 Microchip Technology Inc.
    Days remaining until demo becomes feature limited: 39

  16. January 11, 2007 at 11:34 AM | #17

    ricky – I sent you an email about programming and shipping the PIC18F2550s.

    VENKAT – You will need to use the CCS C compiler to compile this code. The licensed version includes the header files for the PIC18F2550 and USB stack. I use PCWH v3.249.

  17. Andrey
    January 11, 2007 at 3:58 PM | #18

    Hello, Steve! With past holidays!
    I ask to forgive me for bad language, I use the machine translator.:)
    I have successfully repeated your project GLCD Oscilloscope DR1r1 having used .HEX a file. Many thanks, very much was pleasant.
    And with this project at me it is impossible. As used .HEX a file. Programmed through MPLAB 7.51 and ICD2.
    The controller is programmed, at connection of a cable is defined(determined) correctly. But at start, the program of display works very slowly, and does not display signal ADC. In a line of reading there are one 0 and CRC OK. To close her(it) too it is not possible. Only compulsorily, through a program manager. Will not prompt, in what there can be a reason?
    Unfortunately, at my order only HT PICC18 and C18, and the file, is probably compiled without an opportunity of debugging with ICD2. whether there is no at you opportunity to make .HEX a file which can be debugged with help ICD2 from Microchip?
    Yours faithfully, Andrey. Moscow.

  18. Halfnoodle
    January 11, 2007 at 4:39 PM | #19

    Hello Steve

    I am working on a project is related with USB and this example is a perfect example project for me. Is it possible that you can share the tiny bootloader source code (SAC_tinybld18F2550usb_20MHz_115200_48MHz) in C with me?, if it is okay, can you please sent it to hunguyen9@yahoo.com. I am very appreciate.

    best regards,

    Hung

  19. January 12, 2007 at 1:44 PM | #20

    Andrey – Does the computer recognize that the PIC is connected to the PC? A small dialog box in the lower-left-hand corner should come up saying “Semifluid.com”. Double check the device manager to make sure that it was correctly recognized. I’ve had this happen before and there have been three solutions that solve most of the problems:

    1. Make sure that you have a decoupling capacitor right next to the PIC’s power pins. I would suggest a 0.01uF capacitor. The USB power is often relatively noisy and the decoupling capacitor minimizes power fluctuations.
    2. Make sure you have a 220 nF capacitor on the Vusb pin of the PIC. It is a stabilizing capacitor that is used for the onboard USB voltage regulator. The datasheet says it’s necessary, so I highly recommend using one.
    3. Make sure your oscillator is accurate. Unfortunately, resonators can be relatively inaccurate (compared to crystals), so you should make sure that it is oscillating at the correct frequency.

    Hung – Unfortunately I don’t have the bootloader source code in C. It is only supplied in assembly on the Tiny PIC Bootloader website, so I modified it for the higher speed PIC18F2550. Sorry!  Good luck with your project though and please let me know how it turns out.

  20. Andrey
    January 12, 2007 at 3:16 PM | #21

    Hi, Steve! Thank for a prompt reply.:-)
    Yes, the device is defined(determined) correctly. With help USBView I see, that all descriptors of the device are read correctly. But the exchange with the program is not present, though at connection of a cable there is an inscription “Connected”.
    Similarly project USB HID I/O behaves also. More precisely, the program on a computer.
    Shows “Connected”, buttons are pressed, but line READ only zero and CRC OK. But she(it) works obviously faster and allows to close herself.:-))
    Probably that a problem in my operational system? At me it is established XP SP2.

    On item 1
    On a model payment at me the distributed(allocated) capacity from 5 ceramic capacities in the general(common) capacity about(near) 5 uF and elektrolitic 220 uF. Pulsations PWR (4,93V) do not exceed 5 mV.
    I have added still 0.01uF directly on conclusions PIC but it of nothing has changed.;-)
    On item 2
    Capacity on pin Vusb PIC – 0.22uF. A pressure(voltage) – 3.44V.;-)
    On item 3.
    I have quartz 20 МГц+2×22 pF on GND. Generation is.
    There are some more ideas where to me to search for a mistake? Very much it would be desirable to start these projects!;-))
    Yours faithfully, Andrey. Moscow.

  21. January 14, 2007 at 1:48 PM | #22

    Andrey – Unfortunately the program will say CRC is ok if it reads 0′s from the USB I/O because of the way the CRC is calculated. I will need to fix that in a future revision to make it clear that there is an issue. The PIC will never respond with 0′s. As for the suggestions I made:

    1. The lower capacitance decoupling capacitor is important for the PIC’s power pins. Higher capacitance is not necessarily better and will not cancel out high frequency noise. Even if it did not seem to help, it should reduce the noise, which is always beneficial!
    2. The Vusb sounds ok.
    3. A quartz crystal is better than a resonator (which I use!), so it is good that it is working.

    I would recommend that you try my PIC18F2550 USB HID IO firmware. It has all of the features of the oscilloscope plus others including allowing you to manipulate individual pins. I would try reading bytes and seeing if the program correctly responds (i.e. reads non-zero values from the PIC). If it does but only sporadically, then there is definitely an issue with the PIC circuit. Please keep me updated!

  22. Andrey
    January 14, 2007 at 2:21 PM | #23

    Hi, Steve! Thank for advice(councils), I shall try variant PIC18F2550 USB HID IO.
    Program SnoopyPro 0.22 I have an opportunity “to overhear” an exchange on USB PIC. That could consider.
    At a stage of initialization USB, reception of descriptors has not absolutely understandable termination(ending). There are packages which are not determined with a direction of an exchange. I shall look further. I yet very well know logic of an exchange on USB.
    As soon as something concrete I can tell, I shall inform.
    P.S. OFF. While waited for your answer, accustomed with CCS+MPLAB 7.51 on project GLCD. It has turned out!:-)
    The initial code completely the worked, however in function of the analysis of start of measurements was necessary to add a delay 1uS that MPLAB did not swear on small time Tad. I have made it so:
    [NOTE: Posts combined by Steve to reduce clutter]

    if (useThreshold == 1) {
    k = 0;
    delay_us (1);
    while ((k<65535) && (readADC()>tempThres)) {
    delay_us (1);
    k++;
    }
    ...
    }

    And still I LCD XIAMEN has not time to fulfil the command of management from PIC. Has defined(determined) it having replaced quartz 20MHz on 10MHz.:-)
    Yours faithfully, Andrey. Moscow.

  23. Glenny Boy
    January 14, 2007 at 3:58 PM | #24

    Hey, I saw a guy asking about using usb with the pic chip. Its simple dude, for this application you wont be using much memoryso use MicroC. It has a usb library built it. Its fairly easy to use! :P

  24. January 14, 2007 at 4:19 PM | #25

    Andrey – I combined all of your posts and corrected the syntax for the code, so I hope you don’t mind. It seems like there is a problem when my blog software, WordPress, sees open and close carrots (these: <>). I am going to try to incorporate some basic editing controls for WordPress so that you can change your posts.

    I did not realize that there would be an issue with aquisition (Taq) time, but I am glad that you noticed it! I will make sure to incorporate it into my next revision (which will hopefully use rotary encoders and/or pushbuttons to change settings). Please let me know if the USB HID IO firmware works!

    Glenny Boy – Thanks for the suggestion! I use CCS C, which also includes a USB library. I haven’t looked into MicroC, but I will now.

  25. Andrey
    January 14, 2007 at 11:40 PM | #26

    Steve – Thank for correction.:-)
    Probably that the mistake with time of sample really is not present, and there is mistake MPLAB of a simulator. At viewing listing it is visible, that the compiler does(makes) a delay 35uS. IMHO, it more than is enough. Probably even it is too many. For reduction of this time it is possible to try to use own function of start and reading ADC. I shall think.
    Concerning recommended MicroC. Among my familiar programmers the greater popularity uses HITech PICC as more floppy tool.
    Yours faithfully, Andrey. Moscow.

  26. Andrey
    January 15, 2007 at 1:01 PM | #27

    Hi, Steve!
    My next comment is posting in topic about USB HID IO. ;-)
    Yours faithfully, Andrey. Moscow.

  27. AISYAH
    January 16, 2007 at 8:12 AM | #28

    hi..i want to ask some questions here..can u please tell me if your oscilloscope can be digital storage oscilloscope?i mean,is this oscilloscope able to store the waveform like digital storage oscilloscope builded by thomass grocutt..

  28. January 16, 2007 at 10:52 AM | #29

    AISYAH – I haven’t seen the digital storage oscilloscope built by Thomas Grocutt, but I appreciate your letting me know about it! His oscilloscope is very fast and quite complex. My project was designed with simplicity in mind, therefore there are a few tradeoffs. This oscilloscope does not buffer the input signal, so you need to make sure that the signal does not deviate significantly from the internal ADC’s input specifications (0V – 5V). It does function as a very rudimentary storage oscilloscope. The waveform can be stored longer, but additional memory would be necessary.

  29. Magesh kumar
    January 21, 2007 at 4:06 AM | #30

    What is the frequency range of the osciloscope?

  30. January 21, 2007 at 9:04 PM | #31

    Magesh – Please see here.

  31. sayantan
    January 27, 2007 at 5:26 AM | #32

    I have compiled the code.And loaded the hex code.But when i connecct the device.”Usb device not recognised” pop up window comes.i am a newbie and have less knowledge on usb.what should i do to fix it.

  32. January 27, 2007 at 12:40 PM | #33

    sayantan – Please see this comment http://www.semifluid.com/?p=24#comment-182 and let me know if any of the solutions work (decoupling capacitor, Vusb stabilization capacitor, and different osc.).

  33. cynder
    February 1, 2007 at 1:51 PM | #34

    Hi Steve, you have a great page and all your projects are amazing.

    Do you know if it only works on PC with USB 2.0 ?

    I’ve connected the PIC to a PC with hardware USB 2.0 and it works, but when I connect another PC with USB 1.1, it doesn’t work.

  34. Francesco
    February 1, 2007 at 3:58 PM | #35

    Done it!

    It is working perfectly after adding a 10n decoupling capacitor.
    Now I have a little question: I am using this oscilloscope to test an accelerometer with the software of the other project, the one with only 1 analog input. This one has 5 analog inputs. How can I see them altogether so I can do a better test on the 3 axis of the accelerometer? I’ve tried to read the vb source, but, apart from little modification to the osc graph(removed the debug adc values, expanded to fullscreen, added more horizontal line with steps of 0.2V for a better reading), I didn’t find where to add new tracks. Am I wrong in something? Can’t I use it to track up to 5 signals?
    Thanks.
    Francesco

  35. Raf Kumar
    March 4, 2007 at 8:57 AM | #36

    Very interesting project!

    I want to get one. Does anyone have this DIY project combined with PIC18F2550 KS0108 Graphical LCD Oscilloscope for sales? Please email to me.

    rafkumar@hotmail.com

  36. Ricky
    March 6, 2007 at 11:55 AM | #37

    Hi Everyone,

    I programmed the bootloader “SAC_tinybld18F2550usb_20MHz_115200_48MHz.HEX” by ICD2, my tiny bootloader program can recognize the PIC, however it cannot write ” 18F2550 USB HID CRC Oscilloscope.hex” on my PIC. But when I programmed “tinybld18F2550usb _20MHz_115200.HEX” from Tiny bootloader by ICD2, and the tiny bootloader can write the code normally.

    Does anyone can help me on it? Thanks.

  37. nea Gogu ingineru
    March 23, 2007 at 3:54 PM | #38

    A quick check showed a report lenth of 8 bytes at a pooling interval of 10ms. Still, how do u get 60ksamples per second? I might be way off here…sorry

  38. anna
    March 28, 2007 at 10:38 AM | #39

    Hi Steve,

    i want to thank you for such a great job and plus, your generosity to share it with us. BIG thanks again.

    anyway, can you please show, if possible; how to save the wave into a file, so that, we can re-open the file without having to connect to the circuit again.

    advanced thanks!

    anna.

  39. Rajesh
    April 10, 2007 at 5:05 AM | #40

    Hi Steve,

    I need to implement a USB interface for my Data Aquisition project. I went through your USB HID OScilloscope project and I think i will be suitable for my project. I need to acces 16bit data from my DAQ board and transfer it to the PC using ur example.. Can U compile a code for PIC18F2550 and mail me the same….

    Else couldu pls explain in detail of how to go about using the USB interface. I’ve absolutely no experience in PIC programming.

    Sincerely awaiting reply.

    Regards Rajesh.

  40. tibi
    June 6, 2007 at 6:56 AM | #41

    What c compiler do you use???

  41. Paul
    June 11, 2007 at 9:50 PM | #42

    Hello

    How can we do FFT (spectrum analysis) with that PIC18F2550 USB HID Oscilloscope ?

    Thank

    Paul

  42. mady
    June 12, 2007 at 8:12 PM | #43

    hello,
    I have a problem with my PIC18F2550 USB HID Oscilloscope. If i hava a logitec mouse (it’s a hid device) the osciloscope wont work properly.
    please help me

  43. mady
    June 12, 2007 at 8:12 PM | #44

    hello,
    I have a problem with my PIC18F2550 USB HID Oscilloscope. If i have a logitec mouse (it’s a hid device) the osciloscope wont work properly.
    please help me

  44. Gil
    June 17, 2007 at 5:52 AM | #45

    Hello and thank to see us your project!

    I have question about the oscilloscope software and the sample rate :

    I got ok the A/D information from the PIC ( PIC18F4550 )
    I used the PICDEM FS USB DEMO BOARD from microchip:

    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en021940

    I see the information OK in the oscilloscope software.

    But… the sample rate is only 1mS max.
    Even I try to change the period in the software to below 1mS the rate remain the same.

    The sample rate not change and I check it in real oscilloscope. when I connect his prob to the USB pin
    I saw only “data train” of the 1mS.

    ALSO If I set the “continuous read” to off and I press
    on the ” Get ADC Data” I do not see the graph change when I change the voltage on the PIC pin in the middle of that sample mode before it is stop.

    In that mode of “not continuous read” it’s take about 5 second to the graph line to move from the left to right. After it got to the right it stop. the read data after it stop is the ONLY last AD value even I, as I wrote below,
    change the voltage on the PIC pin in the middle of that sample.

    What wrong?

  45. Gil
    June 17, 2007 at 6:31 AM | #46

    OK
    I think I understand more:

    When I press on the “Get ADC Data” the PC software
    send to the PIC command to fill his internal buffer.
    After the buffer is full it send the data to the USB port to the PC.
    So, we only saw the graph after it gat the AD data
    and not in real time like in real scope.

    The time that we see the cursor line move from left to right is not relevant. it is only show the rate of the
    USB received data from the internal buffer to the PC.

    That matter was confuse me.

    Thanks.

  46. Alpman
    June 25, 2007 at 3:59 PM | #47

    Hey All,
    I am trying to add a isolation to both usb and analog side of the project to protect my analog source and computer. Optic isolation would work. Do you have any idea to lead my work?
    Regards
    -Alpman

  47. Modassar
    July 10, 2007 at 4:40 AM | #48

    Hay can any one tell me a copleate 8 bits commig in parrallel bits form to usb micro controller circuit diagram & its code i badly needs it

  48. Andrew
    July 12, 2007 at 1:46 PM | #49

    Which VB compiler and version did you use for building the Visual Basic example oscilloscope software with DFT?

  49. Christoph Graf
    July 30, 2007 at 3:49 AM | #50

    Hi
    I made a PCB (using eagle from Cadsoft) for the scope. It’s a single sided PCB board so even no problem do produce them at home.
    If interested send me an email and I will send you the .brd and the schematics.

    Best regards

    Christoph Graf

  50. Will
    August 8, 2007 at 1:30 AM | #51

    Hi Christoph,

    I am doing a project for the Oscilloscope, and I am very interested in putting the circuit on a breadboard. Can you send me the .brd and the schematics to my email.

    presleyw1@gmail.com

    I noticed that you said it could be done at home if possible could the schematics be sent in to a company to get the board? If not, how did you do it at home?

    Thanks alot

  51. Will
    August 25, 2007 at 5:42 PM | #52

    Hey Gill, I just purchased the PICDEM FS USB DEMO BOARD from Microchip. My operating system is Windows XP. When I run the program it doesn’t recognize the board. It should be able to be selected from the drop-down menu. In the demo mode it sees it but in bootload mode it cannot. Any suggestions?

  52. NISHIT KHANNA
    September 17, 2007 at 5:40 AM | #53

    Hey Steve,

    I went through your work and it is just awesome.

    Well, i have a project to do on the same and frankly,i have very little knowledge on designing an oscilloscope ,,specially using VB as i have been asked to do so. Can ya plz help me out with this design using VB….Its my project in college and it carries some marks.I need ur help in it.Plz reply.

    I will be really grateful..

    Thanks.

  53. Will
    September 19, 2007 at 5:52 PM | #54

    Hey Steve,

    I am trying to use your project with my PICDEM FS USB DEMO board and its not working. I kind of know what the problem is. I need to changed the location of where the code starts and ends because my bootloader uses certain sections of memory. To edit the code I need CCS PCH compiler, I assume you already have it. I am trying options besides buying the compiler because I am a hobbyist and its expensive. Is there to use the C18 compiler through MPLAB to compile the c file instead of PCH compiler?

    P.S. This question is open to anyone who knows the answer.

  54. zech
    September 21, 2007 at 4:17 AM | #55

    Hello Christoph…

    Can you send me the .brd and the schematics to my email??

    tenno_mafioso@yahoo.com

    Please and thank you..

    • vietnam
      May 11, 2012 at 5:34 AM | #56

      Can you send me the .brd and the schematics (pic 18f2550 hid usb) to my email? thank very much for your help!

  55. Raoul
    September 23, 2007 at 3:14 PM | #57

    i am doing a similar project with the PIC18F2550. How does the computer recognize the PIC. Since the PIC has a built-in USB controller??

  56. iddhien
    October 10, 2007 at 2:50 AM | #58

    Hello steve,

    I’am is new comer in USB, I want to change the PIC18F2550 to PIC18F4550, what the part to change if i want realize this oscilloscope project???

    Regards,

    iddhien

  57. khoa
    October 17, 2007 at 7:40 AM | #59

    can pic18f2550 download code into internal meomory

  58. Rujoi Laurentiu
    November 5, 2007 at 6:29 AM | #60

    do you program the PIC with the loader that you said and the rs232 connection? don`t you need a JTAG type interface ?

  59. Sadat
    November 11, 2007 at 2:35 AM | #61

    Hi, Sounds nice. Please also add Multiple Voltage Monitoring and Current. This will be very nice.
    Thanks
    Sadat

  60. umitfidan
    November 26, 2007 at 11:58 AM | #62

    hi..thank you very much for usb oscilloscope..can i measure 20khz soundwave or higher with pic18f2550.someone wrote that it has 60ksps…best regards

  61. Joe Kissell
    December 28, 2007 at 12:30 PM | #63

    “Using HID means that this oscilloscope does not require drivers (only the oscilloscope software).”

    I thought all devices connected through the USB port required a driver in order to communicate with the PC…?
    I’ve used FTDI chips in my past projects. Once the FTDI driver is installed the USB device shows up as a COM port on the PC. I then used the COM Control in VB6 to communicate with the device. It’d be MUCH nicer if I didn’t have to use the FTDI chip or it’s driver!

    Do you have a good website or other information you can provide so that I can learn more about this?

  62. Roland
    February 6, 2008 at 5:53 AM | #64

    Helo,
    Where i can find the source code ( C or hex) to program the pic18f2550 to use the USB ?
    Thank for your answer.

  63. Angie
    March 24, 2008 at 11:32 PM | #65

    hi,

    i’m very new to microchip. need to do a similar proj for my college assignment.

    i have a similar qn here. if i were to change pic18f2550 to pic18f4550. which are the parts i would need to modify?

  64. Simon
    April 6, 2008 at 6:41 AM | #66

    could someone please help me with this code as i only have access to compiler version 4.057 and i’m unable to compile it without any errors.

    plus i’d like to use an 18f4550 instead as i have these already.

    any help would be very appreciated

    thanks

  65. April 12, 2008 at 5:05 PM | #67

    I would like to build the oscilloscope with the MAX114 you described above, how do i modify the firmware? do you have the firmware for this modification? also how the MAX114 is connected to the PIC? Thanks, If anyone knows about this I would be very grateful if you respond me to “carloscuev AT gmail DOT com”

    Sorry for my english, my everyday language is spanish :P

  66. Simon
    April 27, 2008 at 10:14 AM | #68

    hi,

    after a while of trying to get this to compile on ccs 4.057 i have almost got it but i have one error that is driving me crazy!

    its on the following line:

    #if (sizeof(USB_CONFIG_DESC) != USB_TOTAL_CONFIG_LEN)
    #error USB_TOTAL_CONFIG_LEN not defined correctly
    #endif

    when i compile i get the following errors:

    >>> Warning 215 “C:UsersSimonprojectsoscopeusb_desc_hid 8-byte.h” Line 166(1,1): Undefined identifier USB_USE_FULL_SPEED
    *** Error 119 “C:UsersSimonprojectsoscopeusb_desc_hid 8-byte.h” Line 201(13,56): 41 not defined correctly

    please help

    i’m almost there

    also i’m also interested in using the max114 with this project and any help would be awesome

    thanks Simon

  67. Eder
    May 27, 2008 at 9:43 PM | #69

    Hi Steve, I have a 16Mhz xtal, I change the code for the bootloader, but I would like to know if I can change your code for the oscilloscope, because the bootloader works fine, but when i plug it i get the “Usb device not recognized” message. I got the 2 capacitors (decoupling & Vusb) and the result is the same. how can i change the frequency of you code?

    I know it would be easier to get a new 20Mhz xtal, but i want to do this as an exercise.

    Kind Regards

    Eder.

  68. Eder
    May 28, 2008 at 12:43 AM | #70

    I make it work!!!!!, i just have to change the options on mi programmer.
    Thanks for this great project.

    greetings from Colombia.

    Eder.

  69. edgey
    May 29, 2008 at 7:22 AM | #71

    has anyone recompiled this for pic18f4550?, I’m a newbie and have not much experience with these chips. Or MP complier. Any assistance would be great
    Cheers

  70. Fabrizio
    June 13, 2008 at 8:23 AM | #72

    Hi Steve,
    I’m very new in microchip, so to learn I started to make simply project and load the programmed and compiled from others.
    I tried to realize your USB oscilloscope with PIC18F2550 and 20MHz crystal but I catch ever the message “Usb device not recognized”.
    I suspect that I wrong the correct value for the configurable bits
    located in the PIC18 at the addresses beginning at 0×300000.
    To load the .HEX file to PIC I use the PP18 software with a selfmade SCHAER programmer. The settings I used are:
    HS & PLL x4 (it’s the only chice with HS & PLL)
    PLLDIV = 20MHz
    CPUDIV 96MHz/2
    USB 96MHz bit = ENABLED
    USB VREG = ENABLED

    In your opinion is it correct ?
    thanks in advance

    rgds
    Fabrizio

  71. Fabrizio
    June 17, 2008 at 3:49 AM | #73

    I changed software to load the code on PIC18F2550.
    With WinPic800 all works fine now.

    bye

  72. Gabor
    June 18, 2008 at 6:53 AM | #74

    Hi!

    I want to use this osc to debug my car’s ignition system.
    Is it good for me?
    If i want to use 12v as input, is it enough to use a resistor on the input?

  73. Nigel Mercier
    July 18, 2008 at 7:44 AM | #75

    Is there a PCB layout available for this?
    Does the software work with Windows Vista?

  74. Doncso
    July 30, 2008 at 5:02 PM | #76

    Hy Steve! Im a hungarian electronic student, im dont speak english, just a little. So, i bulid this schematic, i use the bootloader, and write the hex on the pic, thats OK, I start the oscilloscope program, the program say’s “device connected” -OK, i push any button, the program is very slow, and the display is empty, i connected the analoge input on the PIC, an wave generator, but nothing. Please help me. Thannk, and sorry for my speak, but i really dont speak english.

  75. sky lim
    October 27, 2008 at 11:34 AM | #77

    hi,i am impress with your project.
    i am interested to do a data acquisition system with usb pic microcontroller.
    but i am a newbie in usb programming. i dunno how to start.
    can you send me the code for pic and guide me how to write the code to make usb work ??

    thanks

  76. sky lim
    October 27, 2008 at 11:35 AM | #78

    anything u can send to my email skycc86@yahoo.com

  77. Islam Essam
    November 8, 2008 at 2:07 AM | #79

    Thanks a LOT for that nice and simple oscilloscope Steve , Works great for me.

  78. Duby
    December 11, 2008 at 8:35 AM | #80

    Hi!
    I have made PIC18F2550 Sope and now I have one question?
    Have anyone solve how to receive 512 bytes of PIC_RAM_data at once?
    Because if we read one-by-one it is to slow.

  79. VAhid Ali Mohammadi
    December 21, 2008 at 6:38 PM | #81

    hello .
    thank u 4 this.
    please this project with avr micros.

  80. AJ
    January 11, 2009 at 4:15 AM | #82

    Man, your projects are amazing! I love the simplicity of your circuits and with this one, the moment i plugged in the USB cable, the device registered under your website’s name Semifluid. I burnt the USB Oscilloscope hex directly to my PIC without using the bootloader hex and it worked flawlessly!

    I truly appreciate you for all the energy and time you put into this and THANX for making it easy for us all!!!

  81. Viktor
    January 27, 2009 at 9:59 AM | #83

    Greetings, Cteve! To me 58 years. It would be time to finish already with any hand-made articles, but having seen your project, has decided it to repeat. I not the programmer, and the electronics engineer therefore for me this elementary ?????? have caused difficulties. I have programmed PIC18F2550 only a file 18F2550 USB HID CRC Oscilloscope. Has started program PIC18F2550 USB HID Oscilloscope DR1r1 VB Example. The program has seen the arrangement (USB Device: Connected) and on it all has ended. What I not so have made? At me operational system Windows Vista is mounted, can because of it? A signal has not seen. Will prompt please in what my error.
    Yours faithfully, Victor Moscow.

  82. ARD
    March 7, 2009 at 10:45 AM | #84

    Hi, managed to get the bootloader into the PIC; but now, tinybld says

    “pic sending unknown data: “K” 0h=
    Check baudrate & Start Write while PIC is not sending serial data (e.g. in reset)
    ERROR!”

    Cant figure out whats happenning. Double-checked the hardware, crystal value, problem persists.

    Any idea what could be the problem, folks?

    Alternately, does someone have a composite snap of the PIC (main file+bootloader) as a single file I could directly program?

    Thanks and Regards,

    Anand

  83. March 7, 2009 at 10:56 PM | #85

    Hello can i use 18F14K50 instead of 18F2550.

  84. olakunle
    April 25, 2009 at 5:03 PM | #86

    pls can 16F8747 be used instead of 18F2550 to have a usb oscilloscope

  85. May 3, 2009 at 3:43 AM | #87

    Woww it works fine!!!!!!!!! 10
    Thanks Steve. God bless you!!

  86. Carlos Marrero
    May 3, 2009 at 9:03 AM | #88

    Excelent project!!!!! I’m working on modifying de VB software to make it more usefull, but it works great!!!!!!!!!!

  87. Duby
    May 12, 2009 at 6:43 AM | #89

    Have anyone idea how to speed up this oscilloscope? PIC ADC is very fast but USB transfer is slow!
    thx.

  88. Nick
    June 10, 2009 at 9:03 PM | #90

    Thanks Steve, for an interesting site and great projects. I got this working fine after a little playing around. Couple of things that may help others -

    - .01uF decoupling cap should really be included in the schematic. Like many others I had major issues without it.

    - Conflict with MS optical USB intellimouse. Device is detected fine, reading from ADC within a second or so is fine, then no more data transfer. Restarting the software gives another ~1 sec of ok data. Unplugging the mouse resolves this issue.

    Anyone have any suggestions on how to resolve the apparent conflict with [some] other HID devices?

  89. bob
    July 6, 2009 at 4:12 PM | #91

    hello steve, Is it possible that you can share the tiny bootloader source code (SAC_tinybld18F2550usb_20MHz_115200_48MHz) in asm and/or in c
    as i would like to know the inner workings of this loader?

    i would like to make this project when i assemble all he parts i need,

    it would be an ideal project for me to work on and to develop

    i have in the past dabbled in the 16f84a perogramming, but now wih to get back into the pic again.

    my email address is woowiggy@yahoo.co.uk

    thanks for your responce

  90. vlad
    September 4, 2009 at 11:58 PM | #92

    so what HARDWARE do i need to program the microcontroller?

    is level converter mandatory?

  91. Rana
    September 22, 2009 at 7:22 AM | #93

    Valad,
    For the first time, you need to put the programmed Microcontroller and for that the simplest programmer to Program PIC18F2550 is;
    http://www.olimex.com/dev/images/pic-pg1-sch.gif

    It works just fine, I have tested it.

    Second, you really need level converter (RS232, required four capacitors 1.0uF or MAX233 expensive, but requires no capacitor at all.

    Level concverters are required as the RS232 port of the PC has high levels while your circuit do have 5v.

    Cheers !

    Rana

  92. alberto
    October 13, 2009 at 9:49 AM | #94

    Someone has developed the code in matlab to read data from USB?

  93. October 15, 2009 at 10:31 PM | #95

    Nice post.But i am confuse What is the frequency range of the osciloscope?

  94. kumar
    October 24, 2009 at 11:04 AM | #96

    hi, i want to how to change the HEX file o the c language.
    thank you

  95. Susan
    November 18, 2009 at 5:34 AM | #97

    Hi Steve,
    I’m really thankful to you for sharing your hardworks. I am final year student from the University of Newcastle Australia. Currently, I am doing my final year project which is exactly same as what you’ve shared, USB Oscilloscope. My project is also using PIC18f2550. May I know few questions below?
    (1) What is your Max Bandwidth from the Analog Input?
    (2) What is your Max Analog Input Voltage?
    (3) If the input range is more than 5V, do you need to build Signal Conditioning Hardware?
    (4) Do you mind to share your GUI Source code? In fact I plan to do a simple GUI, plotting analog data on the X-Y axis and there will be 2 knobs, voltage and frequency adjuster.
    I’ve started my hardware and now trying with few sample A-D conversion, timer and interrupt.
    Please kindly respond to chawchaw04@gmail.com
    Thank you very much.

  96. Dimon4ik
    November 30, 2009 at 10:44 AM | #98

    Hello!!!!! I and have not understood what parametres at this oscillograph, Objasnite briefly))!!!! As this scheme was pleasant!

    To me of 20 years

    Yours faithfully from Ukraine!!!!!

  97. Lucas
    December 11, 2009 at 7:40 AM | #99

    Hi Steve,

    I’ve the same questions than Susan:

    (1) What is your Max Bandwidth from the Analog Input?
    (2) What is your Max Analog Input Voltage?
    (3) If the input range is more than 5V, do you need to build Signal Conditioning Hardware?
    (4) Do you mind to share your GUI Source code? In fact I plan to do a simple GUI, plotting analog data on the X-Y axis and there will be 2 knobs, voltage and frequency adjuster.

    Please let me know the answers lucas.martinoia@gmail.com

    Thanks for share this great work with all !!!

    Lucas

  98. Sink0
    January 21, 2010 at 2:10 PM | #100

    Hi i have started developing USB projects with Steve’s project and i could solve some of its major problems. First of all the real limitation is that if you use the real time option the PIC is going to send just 1 byte each time wht is a real probem couse you are not using the 64 bytes total packet of the HID. The second problem is that the plotting and data transmission are in the same thread so when it is drowing the graphic its stop sending and recive data. The third and final problem is that at Steve project the PIC just send a data when the computer write something to PIC. Thats a real limitation couse at windows you probably can just wirte to divice something like every 3ms. The device (PIC) can send packs something like every 1ms. But with his lib the function send and recive to/from the device all in the same task. Im using another lib at VC++ that can just read from the device. That lib called HID class.dll comes with microchip USB framework that you can find for free at microchip website. I can reach something like 50Ksps and the max theorical with HID is 64Ksps. If you need more you got change to bulk or control. Well thats all.

    Cya

  99. sim1
    January 31, 2010 at 7:21 PM | #101

    Hello Steve this project it is very interesting, i’ve just assembled one…. works great!!! and for my hobbyst is the best project…
    but i also need for study a little scope/datalogger standalone…
    it is possible use this pic/scope as stand-alone for acquire binary data signal at 125khz?
    it is possible acquire more data (more then 512 values? is necessary an external eeprom? 24c256???)
    my email is “simone ma pc (at) libero . it”

  100. qwer
    February 18, 2010 at 1:15 PM | #102

    hello Steve
    i just finished a pic-usb-oscilloscope-project (very similar to yours), when i discovered this blog. I would like to present my solution, which is a little faster. I use one PIC18f2550 as ADC and USB-Device. Its maximal sample rate is 115KByte/s. I managed pushing 128KBytes/s (-> 115KB ADC-result, some useless Bytes and 4 control bytes) to the computer via usb, without data loss. I use 4 interrupt-transfer-pipes in a kind of ping-pong-buffer-mode for this purpose. You are welcome to look at my project which i put in a german pic-forum. (http://www.fernando-heitor.de/component/option,com_smf/Itemid,121/topic,4304.0/) Unfortunately, the description is in german, but there are all source codes of the project for download and some pictures (screen shots of the computer-program).
    qwer

  101. Kansai
    February 24, 2010 at 4:10 AM | #103

    Hello
    I just read the page and read the code. Sorry if this sounds ignorant but where are the files:
    pic18_usb.h and usb.c??? in the code it says CCS USB libs and so far I have been using another compiler but I think that I installed CCS when I did the MPLAB IDE. So where are those files???

    Thanks in advance

    Kansai

  102. jwC
    March 11, 2010 at 2:18 AM | #104

    Hey all,

    I’m just getting started with the 18F2550 and USB when I get it going I have an idea for a high frequency digital oscilloscope that I want to run by you guys. Let me know if you think its possible.

    I’ve noticed a lot of homemade oscilloscopes that run at low frequencies, perhaps up to several MHz, and while these are impressive, they are not that practical for use beyond low frequency projects like audio. If you want to do any of the really fun projects like radio or higher frequency projects then we need to build a scope that can measure waveforms in the hundreds of MHz range, or even GHz. These can be very expensive, so it would be cool if we could design one you can build at home for say, less than 50 dollars. So here’s what I propose:

    Every physically realizable waveform can be represented by an infinite sum of simple sinusoids (Fourier theory). Using a variable, electrically controlled capacitor (varicap?) we create a simple bandpass filter (i think thats the name anyway). The filter allows only certain frequencies through and attenuates or blocks the other frequencies. The varicap can be used to select the desired frequency that we want to test for. The algorithm will be select a frequency, if that frequency is present in the waveform, it passes through setting an import pin to 1 (indicating that frequency is a component of the signal). The desired frequency component to test for is now selected to be slightly higher with the varicap. Again, the signal is tested to see if that particular frequency component is present. If it is it passes through the filter and sets the pin to 1, 0 if it isnt present. The process repeats for a widerange of
    frequencies (say 1000 or so).

    At this point we know which frequencies are present in the original signal, but we need to know both the phase and the amplitude of each frequency present.

    To find the amplitude of each frequency, as each tested frequency passes through the filter we also convert it to a DC voltage using a full wave rectifier and some smoothing capacitors. The DC voltage can then be read by the ADC on the 2550. With the DC voltage known we can mathematically determine what the amplitude of the input frequency was.

    Now all we would need is the phase information. Im not sure how we would go about this though, although im sure its possible to do with passive components (we need to avoid opamps because of their low frequency response). Something to work out i guess hehe.

    Finally with this information collected the waveform is reconstructed from the spectrum (the amplitudes and phase of the frequency components present). As the number of frequencies tested increases the error in the waveform decreases.

    Sorry for the long and poorly worded explanation. Hopefully you guys can figure out what i mean. Please let me know if you think this could work and if you need any clarification on what i have described. Peace.

  103. DevilWarez
    March 22, 2010 at 2:28 PM | #105

    thanks

    circuit is works ok.

    I am not understand english – %20

    very good

    good works

    Turkey

  104. Gandi
    May 31, 2010 at 8:02 AM | #106

    Hello, somebody can help me to connect the usb device on visual basic can you give me the code please. Thank you.

  105. ervan
    June 18, 2010 at 2:44 AM | #107

    Hi Steve this project it is very interesting, i will assembled one…. but i don’t understand the schematic. how to connect crystal, what is connected with the body of the crystal?

    Thank’s

  106. Satheesh C
    June 21, 2010 at 1:29 AM | #108

    Thanks
    Nice work
    Works fine

  107. Armin
    July 2, 2010 at 2:48 AM | #109

    hi , thanks it’s very great !
    can i use 18f4550 instead of 2550?
    what’s hex file for that? it’s very interesting thank you steve for sharing

  108. Akhil
    July 4, 2010 at 9:33 PM | #110

    hi………..i tried the circuit ……………its showing usb device cnnnot be recognized………………pls help…………….sorry for bad english

  109. Erdem U. Altinyurt
    August 11, 2010 at 8:28 AM | #111

    Hi there! Thanks for the project. At least I don’t fear from USB port any more :D

    You application is good but doesn’t works with linux.
    I recreate it’s GUI application using wxPython and pyusb. I can say that it’s much faster than VB…
    It could also work with windows soon (because of there is no libusb1 for windows but libusb0)
    Although It’s easy to convert code to use libusb0 library also. But I don’t care it..

    Here is the my git repo for the python GUI. You could also give link at top.
    http://github.com/EUA/PyOSC

    Regards

    • Valter Fukuoka
      July 31, 2014 at 1:36 AM | #112

      Hi Erdem, thanks for the PyOSC.py effort… I am trying it on Windows 7…

      First, I did change the firmware to run “native” on the PIC18F2550 without the need of the bootloader, recompile and burn it to a 2550 w/ 20MHz oscillator…

      The PC app in Visual Basic works fine!

      When trying PyOSC.py on Windows 7 (Python2.7.6) there are some issues…:

      1)
      File “pyosc.py”, line 115, in on_paint
      h1 = xrc.XRCCTRL(self.frame,’scroll_H1′).GetThumbPosition()
      AttributeError: ‘NoneType’ object has no attribute ‘GetThumbPosition’

      2)
      07:28:15: XRC error: 49: too many children in grid sizer: 6 > 2 x 2 (consider omitting the number of rows or columns)
      07:28:15: XRC error: 49: unexpected item in sizer

      3)
      Traceback (most recent call last):
      File “pyosc.py”, line 85, in OnIdle
      if self.dev.is_kernel_driver_active(0):
      File “C:\Python27\lib\site-packages\usb\core.py”, line 992, in is_kernel_drive
      r_active interface)
      File “C:\Python27\lib\site-packages\usb\backend__init__.py”, line 363, in is_
      kernel_driver_active _not_implemented(self.is_kernel_driver_active)
      File “C:\Python27\lib\site-packages\usb\backend__init__.py”, line 79, in _not
      _implemented raise NotImplementedError(func.name)
      NotImplementedError: is_kernel_driver_active

      Are these “easy” to workaround(on Windows)?

      Thanks,
      Valter

  110. BLACK SAHDOW
    September 17, 2010 at 8:36 AM | #113

    It does not work, the compiler produces many errors, perhaps due to the improper use of the libraries.

    Please could you help me?. I’m making an application in VB6 and I could not compile the file .asm
    with my changes.

    I’m using CCS COMPILER in MPLAB 8.1

    Thanks for the help.

  111. Kras
    October 12, 2010 at 4:19 PM | #114

    How much current&voltage it can consume? Why 20MHz is used instead of 48, i ain’t understand about speed?

  112. evan
    October 27, 2010 at 4:19 AM | #115

    any body can help me,

    1. Why the output generated from the PIC that a half wave?
    2. If the output is displayed at half-wave software, how to become a full wave?

    If you do not mind, do you want to tell me about the software and give an explanation?
    Thank you very much.

  113. Erdem U. Altinyurt
    October 28, 2010 at 7:04 PM | #116

    @Kras:
    It’s not 20Mhz. It’s 48Mhz via internal PLL… I use same code with 4 Mhz XTALL but I set the prescaler of PLL and it become to 28Mhz

  114. Erdem U. Altinyurt
    October 28, 2010 at 7:11 PM | #117

    @evan:
    PIC cannot detect negative voltages. If you put AC signal to ADC pin, than you will see just + voltage.
    You can analyze AC with this circuit too.
    make voltage divider with 2 x 1KOhm.
    +5v |——[1K Ohm]——|——[1K Ohm]——| 0v
    2,5v
    Than put one cable to here and other one to PIC’s ADC pin.
    Now, you will see Zero voltage AC signal as 2,5v that means will easily watch full wave signal…

  115. evan
    November 4, 2010 at 6:40 AM | #118

    @ erdem :
    thanx 4 your explanation..
    and how to make the signal as a sinusoidal wave?
    could you explain to me? Please kindly respon to : akh_nafs@yahoo.com

  116. Josh
    November 22, 2010 at 9:42 PM | #119

    Does anyone have any incite as to how to make this design and program have multiple inputs for the oscilloscope? I’m working on a design project that requires three inputs. Any assistance would be greatly appreciated.

  117. bobo jansen
    December 2, 2010 at 12:25 PM | #120

    Hi Steve,

    I tried to build your scope, but tiny bootloader does not recognize the PIC.
    How far are your plans for using a usb bootloader ?
    Is it possible to load the entire program straight with a programmer ( not using a bootloader at all ),
    and could you give some clues if possible?

    In the mean time I use the 3 channel logic analyser , in my pickit2 programmer with microchip software ( also based on the 18F2550 )

    bobojansen

  118. evan
    December 9, 2010 at 6:16 AM | #121

    any body can help me?

    1. How to determine the ability of sampling for this project?
    2. How to create an algorithm for the period for project?
    3. How to determine the time per div and volts per div?
    4. How to determine the period of the oscilloscope program ?

    If you do not mind, do you want to tell me and give an explanation?
    Thank you very much.

  119. raj
    April 5, 2011 at 11:45 PM | #122

    we designed a usb module(pic18f2550) with an SPI interface . after some time it stops its operation . i tried many solutions but no result . here we are taking data through SPI in every 1 sec and send it to USB data is of 24 byte . initially no problem but after half an hour it stops . any of you can help me in this case
    thanks in advance
    Rajesh

  120. Emeraldy
    November 1, 2011 at 10:57 PM | #123

    Hi steve, greetings from indonesia ^_^

    Thanks for creating this awesome usb hid oscilloscope, it inspired me to create my final project.
    I decided to make PIC 18F4550 usb hid oscilloscope. But my project differs from yours, since i constructed my firmware using mikroBasic pro for PIC, which is based on BASIC languages.

    Generally, my firmware was built inspired from yours. I modify some of your listings. I deleted usb_task(), usb_attached(), usb_enumerated() etc because it doesnt compatible with mikroBasic. I think, using mikroBasic made my listings are shorter than yours :3

    Many thanks, Steve!!

  121. Emeraldy
    November 1, 2011 at 10:58 PM | #124

    Oh and i add this webpage as my references in my report ^_^

  122. Konstantin
    November 15, 2011 at 6:15 AM | #125

    Hi there! Great project!!

    it would be possible to make the circuit to accept AC signals by biasing the microcontroller analog input to half of VCC (Vcc/2). This would be done by a simple voltage divider, say 10k resistor from input pin to Vcc, and another 10k resistor from input pin to ground. Also, as to avoid coupling this DC bias voltage into the AC source, a DC blocking capacitor should be used between the source signal and the analog pin input, say 1 to 10uF, ideally non-polarized. The voltage divider could also be implemented with a preset or potentiometer, giving you the DC offset control of the input signal. With nothing connected to the input, the ADC shall be measuring half the amplitude of Vcc, and any AC analog signal would swing around this center-line.

    Best regards,
    Konstantin

  123. caroline
    February 15, 2012 at 6:20 AM | #126

    can u rectify these errors.i got these while buuilding in mikroc
    error: Can’t open include file “18f2550.h”
    #include
    error: Unknown #directive “device”
    #device ADC=8
    error: Unknown #directive “fuses”
    #fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
    error: Unknown #directive “use”
    #use delay(clock=48000000)
    error: Unknown #directive “build”
    #build(reset=0×1, interrupt=0×8)
    error: Unknown #directive “ORG”
    #ORG 0x0F00,0x0FFF {}
    error: Unknown #directive “use”
    #use rs232(stream=PC, baud=115200, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
    error: Unknown #directive “DEFINE”
    #DEFINE USB_HID_DEVICE TRUE
    error: Can’t open include file “pic18_usb.h”
    #include
    error: Can’t open include file “usb_desc_hid 8-byte.h”
    #include
    error: Can’t open include file “usb.c”
    #include
    error: Unknown #directive “INT_RDA”
    #INT_RDA
    12 errors in preprocessor.

  124. Andre
    April 13, 2012 at 3:40 AM | #127

    Hello,I ask to forgive me for bad language.Can I just with flash programmer once 18F2550 USB HID CRC Oscilloscope.hex, and not SAC_tinybld18F2550usb_20MHz_115200_48MHz.hex. What could be the problem?

  125. Hemantha
    June 5, 2012 at 7:28 PM | #128

    hi everybody!
    i’m trying to sending a data from PIC and get and display it from PC using VB6. i have some knowledge about VB6 but i have little knowledge about PIC.
    Anyone can help me?

  126. PLAAHemantha
    June 16, 2012 at 12:36 AM | #129

    Hi, managed to get the bootloader into the PIC; but now, tinybld says

    “pic sending unknown data: “K” 0h=
    Check baudrate & Start Write while PIC is not sending serial data (e.g. in reset)
    ERROR!”

    Cant figure out whats happenning. Double-checked the hardware, crystal value, problem persists.
    Can i program using USB programmer(eg. Pic kit)? How to do that?
    Hemantha

  127. PLAAHemantha
    June 16, 2012 at 9:43 PM | #130

    hi everybody!
    i’m trying to sending a data from PIC and get and display it from PC using VB6(such as numeric value). But i could not success. I could not find correct Schematic and vb program. I have some knowledge about VB6 but i have little knowledge about PIC.
    I want to send a numeric value from PIC and get and display it on PC, or send pulse from PIC then get and count pulses given time interval and display it on PC
    Anyone can help me?
    Hemantha

  128. Ali fadheel
    June 20, 2012 at 12:25 AM | #131

    I tried the circuit but I have not crystel 48MHz , I have 20MHz I ask change in file 18F2550-USB-HID-CRC-Oscilloscope.c line 16 from #use delay(clock=48000000) to #use delay(clock=20000000)only

  129. eak
    August 28, 2012 at 12:06 PM | #132

    Thank you Steve, works fine for me, i’ve put some information on my site (http://kavea.free.fr/elec2.php) in russian about your project.

  130. Ainash P
    October 30, 2012 at 6:52 AM | #133

    Dear Sir,
    Pls help me by providing Sample code for usb in pic 18f4550

  131. Raguvaran
    November 2, 2012 at 11:35 AM | #134

    Hi,
    Can you send the hex file to raguvarankr@gmail.com. I am still struggling to compile the program.

  132. Jones Woolsey
    November 11, 2012 at 10:18 PM | #135

    PIC18F2550 USB HID Oscilloscope project. Do you have HEX file it seems to be missing from your web page when I click it I only get c source code. Also do you have a Hex version which does not need a bootloader? Thanks

  133. Luiz Antonio
    July 19, 2013 at 11:13 PM | #136

    Friend liked more, Congratulations very Bom.Tenho How to Get One doubts convert this signal into sound wav. Capturing Buffer or Usb Port?

  134. Luiz Antonio
    July 20, 2013 at 4:49 PM | #137

    Você pode me enviar o arquivo. Brd e os esquemas para o meu e-mail?
    luiz_antoniosp@yahoo.com.br

  135. Luiz Antonio
    July 20, 2013 at 4:52 PM | #138

    You can send me the file. Brd and schemes for my email?
    luiz_antoniosp@yahoo.com.b

  136. uditha
    July 30, 2013 at 12:45 AM | #139

    thnks for publishing these kind of projects…actually i followed ur post …i wanna make usb communication device …i used pic18f2550 for this…and i supply +5V externally( only used D+ and D- from the USB ) 20Mhz Cristal and 2x22pf and 220nF for Vusb pin..i used ccs c compiler V.4 i compiled use code and put in to pic..but not detect the pc (VB program)………..reply me soonthank you very much..

  137. babak
    July 30, 2013 at 2:00 AM | #140

    please send me the file. Brd and schemes for my email.tanks
    b.gor55@yahoo.com

  138. master0112
    August 28, 2013 at 3:03 PM | #141

    Hi,
    can I get it working under windows 8 64bit? oscilloscope works unders Windows XP but I have laptop with Win8. Oscilloscope is discovered as USB HID device but device manager shows code 10.

  139. Clésio Leonel Júnior
    October 5, 2013 at 10:22 AM | #142

    is open source?

  140. cerene
    December 4, 2013 at 5:07 AM | #143

    i built the project and i dont have to buy an oscilloscope anymore. i saved my money. it is better than professional oscilloscopes. thank you much

  141. mohd asiqur
    March 2, 2014 at 4:30 AM | #144

    sir, please give the .hex file for usb oscilloscope as i am not able to compile the .c file given in the website .

  1. March 15, 2008 at 2:21 PM | #1
  2. December 10, 2010 at 2:57 AM | #2
  3. April 14, 2011 at 3:17 PM | #3
  4. April 25, 2011 at 1:54 PM | #4
  5. May 29, 2011 at 1:09 PM | #5
  6. January 4, 2012 at 2:52 PM | #6

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>