Author |
Message |
Topic: How to use both pins in ccp2 ? |
doguhanpala
Replies: 9
Views: 18512
|
Forum: General CCS C Discussion Posted: Thu Jul 18, 2019 8:41 am Subject: How to use both pins in ccp2 ? |
I suspect your sensor is actually setting it's pulse high about 2mSec after
the signal, so the existing code picks this up...
You are right.
The last code you suggested worked succesfully. Me ... |
Topic: How to use both pins in ccp2 ? |
doguhanpala
Replies: 9
Views: 18512
|
Forum: General CCS C Discussion Posted: Thu Jul 18, 2019 7:30 am Subject: How to use both pins in ccp2 ? |
maybe this....
int16 TIMER_val;
I think it should be unsigned int16. The timer1 register(s) holds a 16bit value that logically would be an unsigned value.
I could be totally wrong( almost 40*C ... |
Topic: How to use both pins in ccp2 ? |
doguhanpala
Replies: 9
Views: 18512
|
Forum: General CCS C Discussion Posted: Thu Jul 18, 2019 6:46 am Subject: How to use both pins in ccp2 ? |
CCP_2 is a register. It contains the value that was latched from the timer
at the moment the pin triggered, It is defined in the .h file for the processor.
In capture mode (you can program whether i ... |
Topic: How to use both pins in ccp2 ? |
doguhanpala
Replies: 9
Views: 18512
|
Forum: General CCS C Discussion Posted: Wed Jul 17, 2019 7:14 am Subject: How to use both pins in ccp2 ? |
Yes and no....
All you need to do is setup the CCP to be a capture at the start of the distance
routine, and set it back to be a PWM at the end of the routine.
However, it will not generate a PWM ... |
Topic: How to use both pins in ccp2 ? |
doguhanpala
Replies: 9
Views: 18512
|
Forum: General CCS C Discussion Posted: Wed Jul 17, 2019 1:38 am Subject: How to use both pins in ccp2 ? |
Hello everyone,
In my project I have 2 dc motors and an ultrasonic sensor. They both work fine separately. I use 18f4550. The problem is, the motors use ccp1 (RC2) and ccp2 (RC1). My ultrasonic sen ... |
Topic: config of HC-SR04 with PIC18F4550 [Solved] |
doguhanpala
Replies: 16
Views: 48341
|
Forum: General CCS C Discussion Posted: Wed Jul 10, 2019 7:22 am Subject: config of HC-SR04 with PIC18F4550 [Solved] |
That is done with a fuse setting. Check the fuses in the pic header file.
CCP2B3 or CCP2C1
hello gaugeguy,
Thank you for your answer. I have used the CCP2B3 and it worked. There are some calcu ... |
Topic: config of HC-SR04 with PIC18F4550 [Solved] |
doguhanpala
Replies: 16
Views: 48341
|
Forum: General CCS C Discussion Posted: Wed Jul 10, 2019 5:05 am Subject: config of HC-SR04 with PIC18F4550 [Solved] |
Hello,
I have tried the code with a few changes but i could not make it work.
I am using usb communication instead of rs232.
I use my ccp1 pin on something else so i want to use the ccp2(RB3) ... |
Topic: usb connection lost on bootloader |
doguhanpala
Replies: 8
Views: 16751
|
Forum: General CCS C Discussion Posted: Wed Jun 26, 2019 6:54 am Subject: usb connection lost on bootloader |
The bootloader does assume you have CS implemented.
So should i use usb_init_cs() instead of usb_init() ?
I tried that but still no luck. |
Topic: usb connection lost on bootloader |
doguhanpala
Replies: 8
Views: 16751
|
Forum: General CCS C Discussion Posted: Mon Jun 24, 2019 8:11 am Subject: usb connection lost on bootloader |
usb_init_cs checks for the 'connection sense' line being pulled high before
initialising the USB. usb_init initialises it 'without question'.
Connection sense is actually _required_ by USB (if yo ... |
Topic: usb connection lost on bootloader |
doguhanpala
Replies: 8
Views: 16751
|
Forum: General CCS C Discussion Posted: Mon Jun 24, 2019 7:17 am Subject: usb connection lost on bootloader |
Hello Ttelmah,
I have checked and you are right. The first one is not stable. I have shared the wrong verision of code. This is the right version. This works without bootloader. I have checked for ... |
Topic: usb connection lost on bootloader |
doguhanpala
Replies: 8
Views: 16751
|
Forum: General CCS C Discussion Posted: Mon Jun 24, 2019 6:32 am Subject: usb connection lost on bootloader |
No...
The file "usb_bootloader.h"
Needs to be included both in the bootloader, _and_ in the code you are going
to load _with_ the bootloader. The difference is that in the bootloader
... |
Topic: usb connection lost on bootloader |
doguhanpala
Replies: 8
Views: 16751
|
Forum: General CCS C Discussion Posted: Mon Jun 24, 2019 4:43 am Subject: usb connection lost on bootloader |
Hello everyone,
I have a usb code that receieves a char 'a' and sends 'k'. The code works just fine.
However when i upload the code with bootloader windows loses connection. I use the ccs exampl ... |
Topic: bootloader usb problem |
doguhanpala
Replies: 11
Views: 20799
|
Forum: General CCS C Discussion Posted: Tue Jun 18, 2019 11:13 am Subject: bootloader usb problem |
Another interesting problem is when i upload a hex which contains usb, the comm stops after a while and i get usb not recognized error. not on start but after a long time(like 30 seconds). Any ideas?
... |
Topic: bootloader usb problem |
doguhanpala
Replies: 11
Views: 20799
|
Forum: General CCS C Discussion Posted: Tue Jun 18, 2019 10:43 am Subject: bootloader usb problem |
Yes, the ADC code has nothing to do with your USB problem. I just mention it, so that when USB link is good, you'll understand why the ADC results aren't what you expect.
I no longer use any PIC wi ... |
Topic: bootloader usb problem |
doguhanpala
Replies: 11
Views: 20799
|
Forum: General CCS C Discussion Posted: Tue Jun 18, 2019 4:52 am Subject: bootloader usb problem |
Though not 'USB' related these lines of code are wrong...
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports(AN0);
With most PICs, including this one, all clock speeds over 1MHz should NOT ne ... |
|