Hi
I got the 18F4550 to connect to pc but found out that it doesn't go onto the rest of program so that i can't use the HID TERMINAL as the program I have written doesn't seem to run until I disconnect.
I'm new to this usb stuff so not sure where I'm going wrong can anybody help please I'm using mikrobasic pro.
Thanks in advance it could be much appreciated
Dave
18f4550 with Bootloader connected does not run program
- uros.cvetinovic
- mikroElektronika team
- Posts: 803
- Joined: 14 Dec 2015 09:24
Re: 18f4550 with Bootloader connected does not run program
Hi,
What kind of hardware do you use?
How did you established connections?
Can you please be little more specified?
Best regards,
Uros Cvetinovic
What kind of hardware do you use?
How did you established connections?
Can you please be little more specified?
Best regards,
Uros Cvetinovic
Re: 18f4550 with Bootloader connected does not run program
Hi
Thank you for the reply i used the boot loader for the 8 MHz crystal and its working fine now.
The other problem i had was the polling the frequency was incorrect it connects ok now with the HID Terminal.
Just one last thing on this if you could help me please.
What's the best way to read some switches on portb with the 18f4550 i have set the port as INPUTS with TRISD = 0xff
I can read the switches as individual switches and that works ok, but i need to know if two switches are press at once.
I did try just reading the whole portd when i switch was pressed but didn't get the number from the port as expected.
Any help would be much appreciated thanks
Dave
Thank you for the reply i used the boot loader for the 8 MHz crystal and its working fine now.
The other problem i had was the polling the frequency was incorrect it connects ok now with the HID Terminal.
Just one last thing on this if you could help me please.
What's the best way to read some switches on portb with the 18f4550 i have set the port as INPUTS with TRISD = 0xff
I can read the switches as individual switches and that works ok, but i need to know if two switches are press at once.
I did try just reading the whole portd when i switch was pressed but didn't get the number from the port as expected.
Any help would be much appreciated thanks
Dave
- uros.cvetinovic
- mikroElektronika team
- Posts: 803
- Joined: 14 Dec 2015 09:24
Re: 18f4550 with Bootloader connected does not run program
Hi,
Can you please confirm if I understood you right?
You want to know how many buttons are pressed at some point and which buttons are pressed?
Also, can you please zip and attach your project here?
Best regards,
Uros Cvetinovic
Can you please confirm if I understood you right?
You want to know how many buttons are pressed at some point and which buttons are pressed?
Also, can you please zip and attach your project here?
Best regards,
Uros Cvetinovic
Re: 18f4550 with Bootloader connected does not run program
Hi guys
Thanks for you help I have Looked into the code and found a way to read the whole portb on a button press which seems to work ok.
When a button is pressed I send the port data to the USB by copying the port data to the writebuff I set it up by at the beginning.
HID_Write(@writebuff,64)
But because I used dim writebuff as byte[64] absolute 0x540 as in the exampe
It writes all 64 bytes to the pic.
When I transfer the port data to to writebuff it then writes all the 64 bytes and I only want the first one if all switches closed it says 255 but followed 63 zeros.
How can I stop it writing the 63 zeros after the first byte which shows me 255 which I the onlyart I want. As writing all the 64 bytes sends information I don't need and slows it down.
Thanks for you help
David
Thanks for you help I have Looked into the code and found a way to read the whole portb on a button press which seems to work ok.
When a button is pressed I send the port data to the USB by copying the port data to the writebuff I set it up by at the beginning.
HID_Write(@writebuff,64)
But because I used dim writebuff as byte[64] absolute 0x540 as in the exampe
It writes all 64 bytes to the pic.
When I transfer the port data to to writebuff it then writes all the 64 bytes and I only want the first one if all switches closed it says 255 but followed 63 zeros.
How can I stop it writing the 63 zeros after the first byte which shows me 255 which I the onlyart I want. As writing all the 64 bytes sends information I don't need and slows it down.
Thanks for you help
David