Author |
Message |
Topic: PIC18F47K42 IOC on port A |
Momboz
Replies: 3
Views: 15769
|
Forum: General CCS C Discussion Posted: Sun Oct 03, 2021 7:58 am Subject: PIC18F47K42 IOC on port A |
See this sample code by Ttelmah for IOC interrupts on the K42 series PICs.
http://www.ccsinfo.com/forum/viewtopic.php?t=59364&start=22
I had a look to the given example and I find it's easier ... |
Topic: PIC18F47K42 IOC on port A |
Momboz
Replies: 3
Views: 15769
|
Forum: General CCS C Discussion Posted: Sat Oct 02, 2021 1:15 pm Subject: PIC18F47K42 IOC on port A |
Hi
I am trying to get IOC on port A working and I couldn't find out how to do.
//Interrupt routine
#INT_IOC
void IOC_isr(void) { output_toggle(PIN_B0); }
//ma ... |
Topic: PIC16F15325: Timer 2 reset pin T2IN re-map |
Momboz
Replies: 8
Views: 17297
|
Forum: General CCS C Discussion Posted: Sun Mar 01, 2020 10:58 am Subject: PIC16F15325: Timer 2 reset pin T2IN re-map |
I don't have that PIC and a new compiler but I'd look in the processor header file, find the section for 'timer2' and see what CCS calls it. Microchip datasheet, page 312, register 27-4 says T2INPPS.
... |
Topic: PIC16F15325: Timer 2 reset pin T2IN re-map |
Momboz
Replies: 8
Views: 17297
|
Forum: General CCS C Discussion Posted: Fri Feb 28, 2020 9:35 am Subject: PIC16F15325: Timer 2 reset pin T2IN re-map |
I would like to use the T2IN pin to reset the timer 2.
I have the following code lines:
#pin_select T2IN = PIN_A4
setup_timer_2(T2_DIV_BY_128|T2_CLK_INTERNAL|T2_RESET_ON_RE|T2_RESET_FROM_T2IN ... |
Topic: Timer 2 on PIC16F15325 |
Momboz
Replies: 9
Views: 18835
|
Forum: General CCS C Discussion Posted: Fri Feb 28, 2020 7:51 am Subject: Re: Timer 2 on PIC16F15325 |
void setup_timer_2(int32 mode, int8 period, int8 postscaler);
#define T2_DISABLED 0
#define T2_DIV_BY_1 0x80
#define T2_DIV_BY_2 ... |
Topic: Timer 2 on PIC16F15325 |
Momboz
Replies: 9
Views: 18835
|
Forum: General CCS C Discussion Posted: Fri Feb 28, 2020 6:51 am Subject: Timer 2 on PIC16F15325 |
this file.....CCS_15325_Pulses_3.h
we have NO idea what's in it, could easily have incorrect settings
you should always have the CCS supplied processor header as 1st line of code. at least that ... |
Topic: Timer 2 on PIC16F15325 |
Momboz
Replies: 9
Views: 18835
|
Forum: General CCS C Discussion Posted: Fri Feb 28, 2020 6:49 am Subject: Re: Timer 2 on PIC16F15325 |
setup_timer_2(T2_DIV_BY_1, 0, 1|T2_START_IMMEDIATELY);
You're missing the clock source constant. Look in 16F15325.h in the
Timer 2 section. You most likely want the internal clock.
When ... |
Topic: Timer 2 on PIC16F15325 |
Momboz
Replies: 9
Views: 18835
|
Forum: General CCS C Discussion Posted: Fri Feb 28, 2020 6:46 am Subject: Timer 2 on PIC16F15325 |
Where did you make your oscillator settings?
I did the clock settings when defining my device. And it is like this: Internal clock at 32MHz.
This is the first windows when using the CCS PIC Wiza ... |
Topic: Timer 2 on PIC16F15325 |
Momboz
Replies: 9
Views: 18835
|
Forum: General CCS C Discussion Posted: Fri Feb 28, 2020 4:43 am Subject: Timer 2 on PIC16F15325 |
Hi
I would like to use timer 2 on my PIC16F15325 and start it immediately.
With following code I can't succeed in this. I can't get any signal on my scope on PIN_A1.
I would like a free running ... |
Topic: The use of delay for external crystal on a PIC12F1572 |
Momboz
Replies: 2
Views: 9986
|
Forum: General CCS C Discussion Posted: Sun Feb 16, 2020 10:02 am Subject: The use of delay for external crystal on a PIC12F1572 |
Look at the oscillator diagram in the datasheet. It shows no crystal
oscillator support circuit or pins. It has a single CLKIN pin. That's for
an external clock source. Yes, a small number of ... |
Topic: The use of delay for external crystal on a PIC12F1572 |
Momboz
Replies: 2
Views: 9986
|
Forum: General CCS C Discussion Posted: Sun Feb 16, 2020 5:07 am Subject: The use of delay for external crystal on a PIC12F1572 |
Hi
I am having trouble understanding what's wrong with my code on a PIC12F1572.
My code (*.c)
#include <CCS_12F1572_Billy.h>
void main()
{
while(TRUE)
... |
Topic: spi_xfer_in usage on PIC16F15325 |
Momboz
Replies: 5
Views: 16342
|
Forum: General CCS C Discussion Posted: Mon Dec 23, 2019 5:34 am Subject: spi_xfer_in usage on PIC16F15325 |
All spi_xfer functions need the stream name....
They say they don't, but there are issues unless you use it.
Ok. I assume that would mean "data_in = spi_xfer_in(SPI_1,24); in my case"
... |
Topic: spi_xfer_in usage on PIC16F15325 |
Momboz
Replies: 5
Views: 16342
|
Forum: General CCS C Discussion Posted: Sun Dec 22, 2019 5:20 am Subject: spi_xfer_in usage on PIC16F15325 |
I would like to use the function spi_xfer_in for reading an external signal with its clock and the compilation says:
"*** Error 51 "CCS_15325_Micro.c" Line 23(27,28): A numeric express ... |
Topic: Help on CLC1 example on PIC16F15325 |
Momboz
Replies: 4
Views: 12897
|
Forum: General CCS C Discussion Posted: Thu Aug 01, 2019 8:09 am Subject: Help on CLC1 example on PIC16F15325 |
Yes, you're right. I've missed those code lines.
I did review my code and now everything works fine. I did it in an easier way:
setup_clc1(CLC_ENABLED | CLC_MODE_AND);
clc1_set ... |
Topic: Help on CLC1 example on PIC16F15325 |
Momboz
Replies: 4
Views: 12897
|
Forum: General CCS C Discussion Posted: Wed Jul 24, 2019 3:00 pm Subject: Help on CLC1 example on PIC16F15325 |
I thought this is what I have been doing in using the following code for PPS remapping.
#pin_select CLC1OUT=PIN_A5
#pin_select CLCIN0=PIN_C3
#pin_select CLCIN1=PIN_C4
I am directly writi ... |
|