Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 01, 2024, 01:07:00 01:07


Login with username, password and session length


Pages: [1]
Print
Author Topic: Need help USB-SERIAL comm coding ccs PICC compiler.  (Read 6039 times)
0 Members and 1 Guest are viewing this topic.
jaikumar
Junior Member
**
Offline Offline

Posts: 46

Thank You
-Given: 49
-Receive: 18


« on: December 22, 2008, 12:48:18 12:48 »

Hi Need help with this,

Iam able to send bytes to PC, but this function '  usb_cdc_getc();' dosen't seem to return proper value
When i made an output of the data from usb_cdc_get() i only get 00 hex value.
COMPILER version 4.078

void main()
{
   BYTE i, j, address, val1;
   char value,val2;
   
   output_low(PIN_B0);
   output_low(PIN_B1);
   value = 'T';
   usb_cdc_init();
   usb_init();
   val2 = 'X';
  while(1)
   {
      usb_task();
      if (usb_enumerated())
     {
//         usb_cdc_putc(value);
         if (usb_cdc_kbhit() == TRUE)
         {
         val2 =  usb_cdc_getc();
         output_high(PIN_B0);
         }
         if (val2 == 'a') {output_high(PIN_B1);}
         if (val2 == 'b') {output_low(PIN_B1);}
      }
   
     }
}

Thanks,
Jai kumar
Logged
kurian2z5
Guest
« Reply #1 on: January 23, 2009, 05:33:48 05:33 »

Please show the rest of the program, the header file where the CDC parameters defined, etc. The virtual com port on your PC must be configured to the same parameters.
Logged
Jagi
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 29
-Receive: 12


« Reply #2 on: January 23, 2009, 02:29:53 14:29 »

Hi Need help with this,

Iam able to send bytes to PC, but this function '  usb_cdc_getc();' dosen't seem to return proper value
When i made an output of the data from usb_cdc_get() i only get 00 hex value.

Hey Jaikumar,
Just posting a part of the code does not help. You need to post the rest of the code, I would say at least please post the code for "usb_cdc_getc()" to help us help you. Hope this helps.
Logged
viji
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 3
-Receive: 2


« Reply #3 on: January 23, 2009, 11:31:29 23:31 »

Hi Jaikumar
 CCS has provided standard working examples Please try.
Logged

jaikumar
Junior Member
**
Offline Offline

Posts: 46

Thank You
-Given: 49
-Receive: 18


« Reply #4 on: January 24, 2009, 06:09:05 06:09 »

I would like to share to all who are using ccs framework/library for usb cdc. It does not work for 18f2450 looks like there is something wrong with the library file. There are a number of posts regarding this problem in
ccs forum.
You are better of using 18f2550 anyway because all the code works, and also it has more RAM. More RAM is required because the USB library itself takes a lot of space about 60% in ccs pcwhd 4.084 and  40% in ccs pcwhd 4.032
I wonder why. Anybody got any ideas please share.


Regards,
Jai
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC