CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 17 matches
CCS Forum Index
Author Message
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Thu May 16, 2019 2:18 am   Subject: USB with 18F2550
A quick update . . .

I modified my RD interrupt to read the data before checking for the 9th bit, this is now working correctly, I've confirmed that the 9th bit being low does actually signify the ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Thu May 09, 2019 8:50 am   Subject: USB with 18F2550
Think about it. .

OK, I have, thanks for persevering with me . . . Embarassed

I've changed the code and now I'm not getting the Status data, but I'm pretty sure I know why, the 9bit going low ma ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Thu May 09, 2019 4:46 am   Subject: USB with 18F2550
Why do you disable INT_RDA?.


The serial data is 50 bytes of status info and is sent every 200mS, I don't need to get it all the time, for example when I'm sending EEPROM data over the I2C to the ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Thu May 09, 2019 4:41 am   Subject: USB with 18F2550
Yes, can confirm. Microchip say in an application note:


Reading the RCREG will load bits RX9D and FERR with new values.


So you need to read the incoming character _before_ doing your test on ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Thu May 09, 2019 4:23 am   Subject: USB with 18F2550
If you look at the CCS 9 bit code, and the Microchip code, they read the
RX9D bit _after_ they read the UART buffer register. My memory is
that the RX9D bit receives the 9th bit when the received c ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Thu May 09, 2019 3:02 am   Subject: USB with 18F2550
Change your #use rs232, to use 16bit fetches for the data from the UART
(manual shows this option), then just getc the int16 and test it's
9th bit.
You current approach has an issue if a second b ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Wed May 08, 2019 10:03 am   Subject: USB with 18F2550
This is where something like an interrupt driven serial
RX helps.

#INT_RDA
void RDA_isr(void)
{

if (RX9D == 0) // check the 9th bit, if low the current byte ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Wed May 08, 2019 8:59 am   Subject: USB with 18F2550
Your circuit does not show 'RS232'. You have TTL serial, or RS485.
You show the connections to the RS485 buffer as 'open'.
On the TTL, you have the TTL serial line TX line directly from the PIC.
...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Wed May 08, 2019 6:57 am   Subject: USB with 18F2550
I'm confused now. You are talking about some other device?.
You said this unit was powered by the USB.
Is this some other device attached to this part?.

Yep, I'm talking about the device that is ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Wed May 08, 2019 6:11 am   Subject: USB with 18F2550
This morning I'm going to create a few Teststand sequences to try and focus in on what is happening at the point where I get USB issues, hopefully I can make it fail on demand and then have a better ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Wed May 08, 2019 3:07 am   Subject: USB with 18F2550
You only seem to have a 10uF on the Vbus across the processor. You must
have a smaller non electrolytic capacitor also across this (say 100nF). On
capacitors, 'bigger is not always better'. Electrol ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Wed May 08, 2019 1:57 am   Subject: USB with 18F2550
Thanks for your help . . . .

OK. That should be alright.
Post your setup (fuses, clock etc..).

This is my setup, some added by the Wizard some by me . . .

#include <18F2550.h>
#devi ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Tue May 07, 2019 8:36 am   Subject: USB with 18F2550
Are you calling usb_task reasonably regularly in your code?. Again this is
'required'. Usb_task handles some parts of the housekeeping in USB. It is
what will re-make the connection if Windows does ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Tue May 07, 2019 7:26 am   Subject: USB with 18F2550
Thanks for the reply.
Have you got 'connection sense' wired and used in the PIC code?.
This is _required_ if the device is not powered by the USB bus.
The CCS notes in the files make it sound 'opt ...
  Topic: USB with 18F2550
RaptorUK

Replies: 32
Views: 56940

PostForum: General CCS C Discussion   Posted: Tue May 07, 2019 5:16 am   Subject: Re: USB with 18F2550
#FUSES VREGEN
I've just added this and the flakyness has gone, I'll keep testing and report back in a day or two, I thought I'd still post this message, it might help someone else.

Oh, and the ...
 
Page 1 of 2 Goto page 1, 2  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group