Author |
Message |
Topic: Switch from PCI16F1938 to PIC16F18857 not working |
gaugeguy
Replies: 12
Views: 2362
|
Forum: General CCS C Discussion Posted: Tue Oct 29, 2024 12:33 pm Subject: Switch from PCI16F1938 to PIC16F18857 not working |
In the PIC16F1938 Timer0 is 8 bit.
In the PIC16F18857 Timer0 is 16 bit. |
Topic: Switch from PCI16F1938 to PIC16F18857 not working |
gaugeguy
Replies: 12
Views: 2362
|
Forum: General CCS C Discussion Posted: Mon Oct 28, 2024 11:38 am Subject: Switch from PCI16F1938 to PIC16F18857 not working |
#fuses is processor specific. You must manually change it to match the new processor.
#use delay can be used to set up the clock input without needing the #fuse directive.
#use delay(clock=4M, ... |
Topic: PIC24F Clock frequency multiply problem |
gaugeguy
Replies: 4
Views: 1667
|
Forum: General CCS C Discussion Posted: Fri Sep 20, 2024 5:53 am Subject: PIC24F Clock frequency multiply problem |
With that processor, the CPU can only run at up to 32MHz. The PLL can be used to get 48MHz for the USB.
You cannot run the processor at 64MHz. |
Topic: Compiler implements hardware Uart or not? |
gaugeguy
Replies: 12
Views: 3475
|
Forum: General CCS C Discussion Posted: Wed Sep 11, 2024 1:53 pm Subject: Compiler implements hardware Uart or not? |
Look at the C/ASM list file. |
Topic: Total beginner - problem with printf missing characters |
gaugeguy
Replies: 5
Views: 2051
|
Forum: General CCS C Discussion Posted: Wed Sep 11, 2024 12:42 pm Subject: Total beginner - problem with printf missing characters |
You should never allow your program to reach the end of the main. Add a while(1); before the closing brace of main.
main()
{
printf("Hello World");
printf ... |
Topic: dspic33EP with external clock source |
gaugeguy
Replies: 2
Views: 1483
|
Forum: General CCS C Discussion Posted: Wed Sep 04, 2024 9:51 am Subject: dspic33EP with external clock source |
I don't have that part, but probably use the setup_oscillator function and let it set the fuses.
setup_oscillator(OSC_CLOCK, 20M, 140M); |
Topic: Capture Mode Input Frequency Measurement |
gaugeguy
Replies: 28
Views: 7805
|
Forum: General CCS C Discussion Posted: Wed Sep 04, 2024 7:13 am Subject: Capture Mode Input Frequency Measurement |
Guaranteed correct operation of all peripherals will be less than one clock cycle.
YMMV |
Topic: ex_use_capture.c - capture of a semi-cycle Pulse Width |
gaugeguy
Replies: 9
Views: 4035
|
Forum: General CCS C Discussion Posted: Wed Aug 14, 2024 9:37 am Subject: ex_use_capture.c - capture of a semi-cycle Pulse Width |
I am not giving you code, just some direction.
capture a rising edge, save as Rising1
capture a falling edge, save as Falling1
capture a rising edge, save as Rising2
time high = Falling1 - Ris ... |
Topic: ex_use_capture.c - capture of a semi-cycle Pulse Width |
gaugeguy
Replies: 9
Views: 4035
|
Forum: General CCS C Discussion Posted: Wed Aug 14, 2024 8:29 am Subject: ex_use_capture.c - capture of a semi-cycle Pulse Width |
A full cycle has three time readings, not just two.
Rising edge, falling edge, & rising edge
or falling edge, rising edge, & falling edge. |
Topic: ex_use_capture.c - capture of a semi-cycle Pulse Width |
gaugeguy
Replies: 9
Views: 4035
|
Forum: General CCS C Discussion Posted: Wed Aug 14, 2024 6:15 am Subject: ex_use_capture.c - capture of a semi-cycle Pulse Width |
Your code is currently capturing every rising edge of the signal. If you want to measure the time high or time low you will need to capture both the rising edge and the falling edge.
You can either ... |
Topic: General advice - first time programmer |
gaugeguy
Replies: 26
Views: 10812
|
Forum: General CCS C Discussion Posted: Thu Aug 08, 2024 1:25 pm Subject: General advice - first time programmer |
Not in a properly written program.
10ms is a long time from a microprocessors view.
200ms is a short time from a human response view. |
Topic: General advice - first time programmer |
gaugeguy
Replies: 26
Views: 10812
|
Forum: General CCS C Discussion Posted: Thu Aug 08, 2024 11:25 am Subject: General advice - first time programmer |
To debounce a switch input you would not use an external interrupt or a change interrupt at all. Just poll the pin input at a regular interval and look for a stable change of state.
An interrupt on ... |
Topic: Program for the stack depth analysis for dSPIC33EP256 |
gaugeguy
Replies: 12
Views: 5639
|
Forum: General CCS C Discussion Posted: Wed Jul 03, 2024 10:05 am Subject: Program for the stack depth analysis for dSPIC33EP256 |
The contents of the RAM are undefined on power up. |
Topic: DSPIC33EP512GP502 -- PCD v5.115 compiler |
gaugeguy
Replies: 6
Views: 5463
|
Forum: General CCS C Discussion Posted: Tue Apr 30, 2024 8:22 am Subject: DSPIC33EP512GP502 -- PCD v5.115 compiler |
If you want to do int8 x int8 with a 16 bit result there are a few ways.
standard C rules:
100L*foo
(uint16_t)100*foo
CCS function to do 8x8 multiply with 16 bit result (fastest)
_mul(100,foo) |
Topic: PIC24EP - Generate 16kHz from a short-sync 8kHz interrupt |
gaugeguy
Replies: 4
Views: 4354
|
Forum: General CCS C Discussion Posted: Mon Apr 29, 2024 12:51 pm Subject: PIC24EP - Generate 16kHz from a short-sync 8kHz interrupt |
It seems like you would need to use the 8kHz pulse to trigger a one-shot pulse and would go low for 31.25us and then go back high. |
|