USB with PIC 18F4455
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: USB with PIC 18F4455
Great ok thanks looking forward to the files.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: USB with PIC 18F4455
Hi Benj,
First of all, sorry for the late reply.
As you asked, I attached the .fcf and .C file.
Regards,
Nicolas L. F.
First of all, sorry for the late reply.
As you asked, I attached the .fcf and .C file.
Regards,
Nicolas L. F.
- Attachments
-
- USB.c
- (13.08 KiB) Downloaded 441 times
-
- USB.fcf
- Flowcode File
- (6 KiB) Downloaded 480 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: USB with PIC 18F4455
Hello Nicolas,
I've had a good look through the C code that your Flowcode is producing and it appears to all be correct. I have also compiled your program here and it is producing identical code and that code is running on the test machines here. Have you tried the device on another PC to see if it is just the one PC that seems to have this problem?
I've had a good look through the C code that your Flowcode is producing and it appears to all be correct. I have also compiled your program here and it is producing identical code and that code is running on the test machines here. Have you tried the device on another PC to see if it is just the one PC that seems to have this problem?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: USB with PIC 18F4455
Hi Benj,
I did not try it on another PC. The one I'm using with flowcode has windows XP.
The other PC have windows vista.
I'll try on windows vista later today.
Regards,
Nicolas L. F.
I did not try it on another PC. The one I'm using with flowcode has windows XP.
The other PC have windows vista.
I'll try on windows vista later today.
Regards,
Nicolas L. F.
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: USB with PIC 18F4455
Hi Benj,
Great news, it's working on my windows XP PC.
I think that you need to restart the PC after installing the driver else you'll get an error, like I had.
I did not change the code, I just connected the PIC to the PC and saw that the PC didn't show me any error.
I opened hyperterminal, but changing the bits per second to 9600 gave me an error.
So I went to the device manager and looked at the parameters of the COM7 (pic serial usb) and changed the bits per second from 19200 to 9600, then reseted the pic.
I opened hyperterminal again, changed bits per second to 9600, flow control to none, then I wrote my name an saw it on the LCD screen.
Everything I'm writing in the hyperterminal is written on the LCD screen .
I'm going to uninstal the driver, instal it again, if I see that there's an error (code 10) I'll reset the PIC and/or restart the PC.
If it works then I'll try to send chars from the PIC to the PC instead of sending chars from the PC to the PIC.
________
EDIT 1:
Like I thought it doesn't work anymore. I did get an error code 10, I reseted the PIC and the error was gone.
I changed the bits per second in the COM7 parameters to 9600.
Then I tried hyperterminal but it gave me an error "Can not connect to COM7, check properties" or something like that.
And right know it doesn't detect it at all !
Right know I'm trying to reflash the PIC with the same program and different VID/PID, but it takes forever to build the ASM.
I'll restart the PC to see if something happens...
__________
EDIT 2:
Okay I'm back .
I needed to hard reboot the PC, because it wouldn't restart. Even with shutdown -a command.
It worked, but I just reseted the PIC and it doesn't work anymore.
__________
EDIT 3:
Still no luck with the PIC. It just won't work anymore...
I did try on another PC (windows vista), installation is ok, but same error in hyperterminal (needed to download it because windows vista doesn't have hyperterminal).
This is the error I get from the hyperterminal.
I'm very disappointed that it doesn't work anymore.
I don't have the courage to continue right now.
I will try, perhaps, another day.
Thank you Benj for helping me.
Regards,
Nicolas L. F.
Great news, it's working on my windows XP PC.
I think that you need to restart the PC after installing the driver else you'll get an error, like I had.
I did not change the code, I just connected the PIC to the PC and saw that the PC didn't show me any error.
I opened hyperterminal, but changing the bits per second to 9600 gave me an error.
So I went to the device manager and looked at the parameters of the COM7 (pic serial usb) and changed the bits per second from 19200 to 9600, then reseted the pic.
I opened hyperterminal again, changed bits per second to 9600, flow control to none, then I wrote my name an saw it on the LCD screen.
Everything I'm writing in the hyperterminal is written on the LCD screen .
I'm going to uninstal the driver, instal it again, if I see that there's an error (code 10) I'll reset the PIC and/or restart the PC.
If it works then I'll try to send chars from the PIC to the PC instead of sending chars from the PC to the PIC.
________
EDIT 1:
Like I thought it doesn't work anymore. I did get an error code 10, I reseted the PIC and the error was gone.
I changed the bits per second in the COM7 parameters to 9600.
Then I tried hyperterminal but it gave me an error "Can not connect to COM7, check properties" or something like that.
And right know it doesn't detect it at all !
Right know I'm trying to reflash the PIC with the same program and different VID/PID, but it takes forever to build the ASM.
I'll restart the PC to see if something happens...
__________
EDIT 2:
Okay I'm back .
I needed to hard reboot the PC, because it wouldn't restart. Even with shutdown -a command.
It worked, but I just reseted the PIC and it doesn't work anymore.
__________
EDIT 3:
Still no luck with the PIC. It just won't work anymore...
I did try on another PC (windows vista), installation is ok, but same error in hyperterminal (needed to download it because windows vista doesn't have hyperterminal).
This is the error I get from the hyperterminal.
I'm very disappointed that it doesn't work anymore.
I don't have the courage to continue right now.
I will try, perhaps, another day.
Thank you Benj for helping me.
Regards,
Nicolas L. F.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: USB with PIC 18F4455
Hello Nicolas,
If you uninstall the device and reinstall then it may be assigned a different COM port number. Are you sure that the COM port number in Hyperterminal matches the device in the device manager.
You may want to close Hyperterminal or at least make sure that it is in disconnected mode before you remove the device otherwise Hyperterminal will lock up and you will have to restart it to get it to work again.
As I say the Slave and HID devices are a bit more reliable. I created my CNC machine using the serial method and I know of all the annoying problems you are talking about. In the end I managed to make my Labview interface (Hyperterminal Replacement) work correctly so it could recover itself if a problem happened but it was a lot of hard work to get right.
If you uninstall the device and reinstall then it may be assigned a different COM port number. Are you sure that the COM port number in Hyperterminal matches the device in the device manager.
You may want to close Hyperterminal or at least make sure that it is in disconnected mode before you remove the device otherwise Hyperterminal will lock up and you will have to restart it to get it to work again.
As I say the Slave and HID devices are a bit more reliable. I created my CNC machine using the serial method and I know of all the annoying problems you are talking about. In the end I managed to make my Labview interface (Hyperterminal Replacement) work correctly so it could recover itself if a problem happened but it was a lot of hard work to get right.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: USB with PIC 18F4455
Hi Benj,
I always quited hyperterminal before unplugging the device.
Also, the com port was ok, I did check it in the device manager.
Never mind, I'll try with USB Slave. I'll wait until you do the video/tutorial you talked about. (hope it won't take too long to make )
Btw, I installed VB 2008. (I saw a VB 2010, isn't this one better ?)
Regards,
Nicolas L. F.
PS: I'd love to make a CNC machine
PPS: I made a little program to drive an LED Dot matrix. Right know its only a "virtual LED Dot matrix". I still need to figure out how I could send the different bytes to the microcontroller.
Here's a link to the program with source code : http://www.mediafire.com/?i1gmz9czr2ql6fu
This is the first video I made (wasn't 100% done) : http://img828.imageshack.us/i/simulationledmatrix.mp4/
I suggest you to read the readme file first
I always quited hyperterminal before unplugging the device.
Also, the com port was ok, I did check it in the device manager.
Never mind, I'll try with USB Slave. I'll wait until you do the video/tutorial you talked about. (hope it won't take too long to make )
Btw, I installed VB 2008. (I saw a VB 2010, isn't this one better ?)
Regards,
Nicolas L. F.
PS: I'd love to make a CNC machine
PPS: I made a little program to drive an LED Dot matrix. Right know its only a "virtual LED Dot matrix". I still need to figure out how I could send the different bytes to the microcontroller.
Here's a link to the program with source code : http://www.mediafire.com/?i1gmz9czr2ql6fu
This is the first video I made (wasn't 100% done) : http://img828.imageshack.us/i/simulationledmatrix.mp4/
I suggest you to read the readme file first
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: USB with PIC 18F4455
Hi everyone,
After having a couple of issues with my USB to RS232 cable I decided to try the USB Serial again.
So, I downloaded some PDF file about USB I found in the Learning Center and some USB example Flowcode Files.
After reading through the PDF file and the USB Serial example I made myself a program.
It uses the keypad e-block, the USB interface e-block and a 18F4455 (not ECIO) with a 4MHz osc.
When I press a key on the keypad it is shown on the LCD screen and in hyperterminal.
I'm still not sure what the problem was but I'm thinking about a wrong clock and/or wrong config in PPP.
Thanks for everyones help.
PS: I attached the program if someone needs it or just wants to see how I did it.
After having a couple of issues with my USB to RS232 cable I decided to try the USB Serial again.
So, I downloaded some PDF file about USB I found in the Learning Center and some USB example Flowcode Files.
After reading through the PDF file and the USB Serial example I made myself a program.
It uses the keypad e-block, the USB interface e-block and a 18F4455 (not ECIO) with a 4MHz osc.
When I press a key on the keypad it is shown on the LCD screen and in hyperterminal.
I'm still not sure what the problem was but I'm thinking about a wrong clock and/or wrong config in PPP.
Thanks for everyones help.
PS: I attached the program if someone needs it or just wants to see how I did it.
- Attachments
-
- usb_test_flowcode.fcf
- (8.5 KiB) Downloaded 440 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: USB with PIC 18F4455
Hi Nicolas,
The configuration was slightly wrong.
If using 19.6 MHz xtal, then you need to change OSC select to Divide by 5 (20MHz input)
Not able to test as a bit late for work, so can't guarantee hardware will work.
The configuration was slightly wrong.
If using 19.6 MHz xtal, then you need to change OSC select to Divide by 5 (20MHz input)
Not able to test as a bit late for work, so can't guarantee hardware will work.
- Attachments
-
- usb_test_flowcode_modified.fcf
- (10 KiB) Downloaded 460 times
Martin
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- Contact:
Re: USB with PIC 18F4455
Hi medelec35,
I'm using a 4MHz xtal and hardware worked fine with the config I had, but thanks anyway .
I'm using a 4MHz xtal and hardware worked fine with the config I had, but thanks anyway .
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: USB with PIC 18F4455
Ahh sorry My bad.Spanish_dude wrote:Hi medelec35,
I'm using a 4MHz xtal and hardware worked fine with the config I had, but thanks anyway .
Missread. Though you was using EB006.
Now re-read I can see the 4MHZ.
I sould not quickly read before going to work in future.
Martin