Help ADC to USB PIC18F2455 Sample Code

General discussion on mikroPascal.
Post Reply
Author
Message
psomkuan
Posts: 6
Joined: 24 Nov 2005 06:55
Location: Thailand

Help ADC to USB PIC18F2455 Sample Code

#1 Post by psomkuan » 08 Feb 2009 10:56

Hi,

I don't understand how to read ADC and send it to pc-usb.
:oops:
___________
Regards,
psomkuan

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Help ADC to USB PIC18F2455 Sample Code

#2 Post by Dany » 08 Feb 2009 11:26

psomkuan wrote:Hi,

I don't understand how to read ADC and send it to pc-usb.
:oops:
Hi,
To send data to the PC via USB you can use e.g. an USB-HID libary like
http://www.mikroe.com/forum/viewtopic.p ... c&start=19.
At the PC side you can use the HID terminal in the mikroPascal compiler's IDE. :D

To read ADC, first look into the PIC datasheet how to configure an input to analog. The reading itself is very simple:

Code: Select all

wordvalue := Adc_Read(channel); 
Have fun! :D
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroPascal General”