how do i send data from a .txt file to a pic18f4550 via usb?

General discussion on mikroBasic for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Red90
Posts: 3
Joined: 27 Mar 2012 19:43

how do i send data from a .txt file to a pic18f4550 via usb?

#1 Post by Red90 » 28 Mar 2012 07:13

hello. i started a mikroC project 2 weeks ago an i hit this problem.:(
i am trying to send the data from a text file from my computer to a pic18f4550 via usb to be proccesd.
example:

in input.txt file we have:

1

i need to send the data from input.txt (in this case 1) to pic 18f4550 to be procced.
var =1(data from input.text)
for var==1
leds on
else
leds off

also if the data in input.txt changes the microcontroller receves the new data automatically.
this is my problem.... please help. i will be really greatfull.
thank you in advance. :)

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: how do i send data from a .txt file to a pic18f4550 via

#2 Post by janko.kaljevic » 28 Mar 2012 10:44

Hello,

I believe that you need to write a PC application for this.
Also do you have any troubles with PIC programming?

Best regards.

Red90
Posts: 3
Joined: 27 Mar 2012 19:43

Re: how do i send data from a .txt file to a pic18f4550 via

#3 Post by Red90 » 28 Mar 2012 19:43

first off all thank you for replying to my post. :) i actually have problems programing my pic. i tried many versions but i just cant seem to make my computer see my pic via usb. i think i have 2 problems:
1-i just cant set up my external oscillator. i tried with 8MHz and 20Mhz quartz but i just cant set up the "edit project" setings.(i dont know how to set it up). also i think i have to set up some registers that control the oscilator's frequency.(internal freq=48MHz for usb)
2-a dont have a schematics for this project. i tried a few versions but none seem to work.

i am using mikroC pro version 5.40 and pickit 3.

i have some basic programing skills in c++. i would be gratefull if you can explain how can i tackle my initial problem and send me some schematics. sending data from a txt file to pic 18f4550 via usb. thank you in advance. :)

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: how do i send data from a .txt file to a pic18f4550 via

#4 Post by janko.kaljevic » 29 Mar 2012 08:38

Hello,

Please notice that there is a simple example for USB HID device included in compiler.
This example uses 8MHz external oscillator, but you should be able to understand clock settings for this controller.
Also following link will be very helpful:
http://www.mikroe.com/forum/viewtopic.php?f=13&t=10646

This example can be found in
Installation directory->Examples->Development Systems->EasyPIC7->USB

You can also check schematics of EasyPIC7 in order to see how to connect your controller to USB:
http://www.mikroe.com/eng/products/view ... nt-system/

Best regards.

Red90
Posts: 3
Joined: 27 Mar 2012 19:43

Re: how do i send data from a .txt file to a pic18f4550 via

#5 Post by Red90 » 29 Mar 2012 19:29

thank you for all your help.:) if i will keep having problems i will seek once again your help. :)

Post Reply

Return to “mikroBasic for dsPIC30/33 and PIC24 General”