![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Markdem
Joined: 24 Jun 2005 Posts: 206
|
CCS CDC ehco problem |
Posted: Fri Sep 01, 2006 10:26 pm |
|
|
Hello, all. I have got one of my devices working with the CDC driver. The problem in that when i type somthing onto hyperterminal, the pic will ehco each keystoke back. This is not the local echo option because if i enable that option in hyperterminal, i will get two sets of echo eg 220000 when i type 200.
Can anyone help me here??
Thanks, Mark
Code: |
include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN,NOBROWNOUT
#use delay(clock=48000000)
#define USB_CON_SENSE_PIN PIN_A3
#include <usb_cdc.h>
int USB_req;
void main(void)
{
usb_init();
while (TRUE)
{
if (usb_cdc_kbhit())
{
USB_req = get_int_usb();
if (USB_req == 201)
{
printf(usb_cdc_putc,"ok\n");
}
else
{
printf(usb_cdc_putc,"200\n");
}
}
}
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Sep 01, 2006 11:24 pm |
|
|
Find the function get_int_usb() shown in bold below, inside the
usb_cdc.h file. Look at its code. It calls the get_string_usb() function.
What lines of code in get_string_usb() could cause your problem ?
Quote: |
if (usb_cdc_kbhit())
{
USB_req = get_int_usb();
if (USB_req == 201)
{
printf(usb_cdc_putc,"ok\n");
}
else
{
printf(usb_cdc_putc,"200\n");
}
}
} |
|
|
![](templates/subSilver/images/spacer.gif) |
Markdem
Joined: 24 Jun 2005 Posts: 206
|
|
Posted: Sat Sep 02, 2006 12:56 am |
|
|
Thank you PCM, i dont know how i missed that.
Thanks, Mark |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|