PIC18F2550 USB HID Oscilloscope
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


November 23rd, 2006 at 2:32 am
What is the frequency range of the scope?
November 23rd, 2006 at 2:33 am
What is the frequency range of the osciloscope?
November 23rd, 2006 at 6:22 pm
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).
December 3rd, 2006 at 5:37 pm
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!
December 10th, 2006 at 8:10 am
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.
December 11th, 2006 at 11:47 am
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.
December 15th, 2006 at 10:39 am
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
December 18th, 2006 at 8:36 am
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,
December 21st, 2006 at 5:34 pm
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.
January 2nd, 2007 at 3:51 am
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.
January 3rd, 2007 at 5:29 pm
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.
January 4th, 2007 at 11:57 am
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.
January 4th, 2007 at 3:36 pm
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.
January 7th, 2007 at 8:14 pm
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.
January 11th, 2007 at 1:57 am
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 Settings\Administrator\Desktop\USB\PIC OSCILLOSCOPE\18F2550 USB HID CRC Oscilloscope.c:22:Error [1027] unable to locate ‘pic18_usb.h’
C:\Documents and Settings\Administrator\Desktop\USB\PIC OSCILLOSCOPE\18F2550 USB HID CRC Oscilloscope.c:23:Error [1027] unable to locate ‘usb_desc_hid.h’
C:\Documents and Settings\Administrator\Desktop\USB\PIC OSCILLOSCOPE\18F2550 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
January 11th, 2007 at 11:34 am
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.
January 11th, 2007 at 3:58 pm
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.
January 11th, 2007 at 4:39 pm
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
January 12th, 2007 at 1:44 pm
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.
January 12th, 2007 at 3:16 pm
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.
January 14th, 2007 at 1:48 pm
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!
January 14th, 2007 at 2:21 pm
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.
January 14th, 2007 at 3:58 pm
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!
January 14th, 2007 at 4:19 pm
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.
January 14th, 2007 at 11:40 pm
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.
January 15th, 2007 at 1:01 pm
Hi, Steve!
My next comment is posting in topic about USB HID IO.
Yours faithfully, Andrey. Moscow.
January 16th, 2007 at 8:12 am
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..
January 16th, 2007 at 10:52 am
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.
January 21st, 2007 at 4:06 am
What is the frequency range of the osciloscope?
January 21st, 2007 at 9:04 pm
Magesh – Please see here.
January 27th, 2007 at 5:26 am
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.
January 27th, 2007 at 12:40 pm
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.).
February 1st, 2007 at 1:51 pm
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.
February 1st, 2007 at 3:58 pm
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
March 4th, 2007 at 8:57 am
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
March 6th, 2007 at 11:55 am
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.
March 23rd, 2007 at 3:54 pm
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
March 28th, 2007 at 10:38 am
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.
April 10th, 2007 at 5:05 am
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.
June 6th, 2007 at 6:56 am
What c compiler do you use???
June 6th, 2007 at 7:10 am
sorry… i found it…
June 11th, 2007 at 9:50 pm
Hello
How can we do FFT (spectrum analysis) with that PIC18F2550 USB HID Oscilloscope ?
Thank
Paul
June 12th, 2007 at 8:12 pm
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
June 12th, 2007 at 8:12 pm
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
June 17th, 2007 at 5:52 am
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?
June 17th, 2007 at 6:31 am
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.
June 25th, 2007 at 3:59 pm
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
July 10th, 2007 at 4:40 am
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
July 12th, 2007 at 1:46 pm
Which VB compiler and version did you use for building the Visual Basic example oscilloscope software with DFT?
July 30th, 2007 at 3:49 am
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
August 8th, 2007 at 1:30 am
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
August 25th, 2007 at 5:42 pm
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?
September 17th, 2007 at 5:40 am
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.
September 19th, 2007 at 5:52 pm
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.
September 21st, 2007 at 4:17 am
Hello Christoph…
Can you send me the .brd and the schematics to my email??
tenno_mafioso@yahoo.com
Please and thank you..
September 23rd, 2007 at 3:14 pm
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??
October 10th, 2007 at 2:50 am
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
October 17th, 2007 at 7:40 am
can pic18f2550 download code into internal meomory
November 5th, 2007 at 6:29 am
do you program the PIC with the loader that you said and the rs232 connection? don`t you need a JTAG type interface ?
November 11th, 2007 at 2:35 am
Hi, Sounds nice. Please also add Multiple Voltage Monitoring and Current. This will be very nice.
Thanks
Sadat
November 26th, 2007 at 11:58 am
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
December 28th, 2007 at 12:30 pm
“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?
February 6th, 2008 at 5:53 am
Helo,
Where i can find the source code ( C or hex) to program the pic18f2550 to use the USB ?
Thank for your answer.
March 24th, 2008 at 11:32 pm
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?
April 6th, 2008 at 6:41 am
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
April 12th, 2008 at 5:05 pm
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
April 27th, 2008 at 10:14 am
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:\Users\Simon\projects\oscope\usb_desc_hid 8-byte.h” Line 166(1,1): Undefined identifier USB_USE_FULL_SPEED
*** Error 119 “C:\Users\Simon\projects\oscope\usb_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
May 27th, 2008 at 9:43 pm
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.
May 28th, 2008 at 12:43 am
I make it work!!!!!, i just have to change the options on mi programmer.
Thanks for this great project.
greetings from Colombia.
Eder.
May 29th, 2008 at 7:22 am
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
June 13th, 2008 at 8:23 am
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
June 17th, 2008 at 3:49 am
I changed software to load the code on PIC18F2550.
With WinPic800 all works fine now.
bye
June 18th, 2008 at 6:53 am
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?
July 18th, 2008 at 7:44 am
Is there a PCB layout available for this?
Does the software work with Windows Vista?
July 30th, 2008 at 5:02 pm
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.
October 27th, 2008 at 11:34 am
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
October 27th, 2008 at 11:35 am
anything u can send to my email skycc86@yahoo.com
November 8th, 2008 at 2:07 am
Thanks a LOT for that nice and simple oscilloscope Steve , Works great for me.
December 11th, 2008 at 8:35 am
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.
December 21st, 2008 at 6:38 pm
hello .
thank u 4 this.
please this project with avr micros.
January 11th, 2009 at 4:15 am
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!!!
January 27th, 2009 at 9:59 am
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.
March 7th, 2009 at 10:45 am
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
March 7th, 2009 at 10:56 pm
Hello can i use 18F14K50 instead of 18F2550.
April 25th, 2009 at 5:03 pm
pls can 16F8747 be used instead of 18F2550 to have a usb oscilloscope
May 3rd, 2009 at 3:43 am
Woww it works fine!!!!!!!!! 10
Thanks Steve. God bless you!!
May 3rd, 2009 at 9:03 am
Excelent project!!!!! I’m working on modifying de VB software to make it more usefull, but it works great!!!!!!!!!!
May 12th, 2009 at 6:43 am
Have anyone idea how to speed up this oscilloscope? PIC ADC is very fast but USB transfer is slow!
thx.
June 10th, 2009 at 9:03 pm
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?
July 6th, 2009 at 4:12 pm
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
September 4th, 2009 at 11:58 pm
so what HARDWARE do i need to program the microcontroller?
is level converter mandatory?
September 22nd, 2009 at 7:22 am
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
October 13th, 2009 at 9:49 am
Someone has developed the code in matlab to read data from USB?
October 15th, 2009 at 10:31 pm
Nice post.But i am confuse What is the frequency range of the osciloscope?
October 24th, 2009 at 11:04 am
hi, i want to how to change the HEX file o the c language.
thank you
November 18th, 2009 at 5:34 am
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.
November 30th, 2009 at 10:44 am
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!!!!!
December 11th, 2009 at 7:40 am
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
January 21st, 2010 at 2:10 pm
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
January 31st, 2010 at 7:21 pm
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”