PDA

View Full Version : High sampling rate of ADC in PIC18F2550 using PBP for USB communication with PC



efarook
- 17th February 2011, 06:49
Hello everybody.

I have created a voltmeter application in PBP 2.6 using PIC18F2550 (20MHz XTAL) that interface with PC using USB interface. It works fine. I created the application using MicroCode Studio (MCS) and EasyHID Wizard.

Now I want to create another similar application that will take samples of AC signal anything at about 1 uS to 20uS sampling rate. This will take samples, convert and send them to PC in bulk, say 512Byte or 1KB at a time using USB. I don't want to use extra RAM chip, because RAM chips are not available in my country.

I have downloaded similar samples found on web, but they used C compilers. The EasyHID wizard uses 1ms polling method and it can only send 64bytes (max.) of data at a time. Is it possible to build my intended application in PBP and MCS?

Expert opinion is expected.

Thanks in advace.

ronsimpson
- 19th February 2011, 19:35
Your PIC18F2550 has 2k of RAM so I think you should be able to send 512 or maybe 1K of data in a packet. That depends on how you store the data. (8 bit, 16 bit, compressed)

Many compilers have a function 'get ADC value'. This function starts the conversion, then waits for the conversion to be done. If you need to read analog very fast you will need to make your own get analog voltage function. It is faster to process data while the ADC is converting the next data.