Author |
Message |
Topic: PIC24: What can make spi_xfer() hang? |
jeremiah
Replies: 14
Views: 15218
|
Forum: General CCS C Discussion Posted: Thu Nov 14, 2024 10:21 am Subject: PIC24: What can make spi_xfer() hang? |
if you are crafty and very very careful, you can setup a timer interrupt, then in the ISR handler inspect the stack to figure out where the interrupt occurred in the main code. If you are running a d ... |
Topic: 16F1823 IOC interrupt |
jeremiah
Replies: 16
Views: 1795
|
Forum: General CCS C Discussion Posted: Sat Nov 09, 2024 10:53 am Subject: 16F1823 IOC interrupt |
So, as I said, you need to show us the first few lines of this file,
functions.c
void Blink_Led (void);
void Blink_CO_Led(void ... |
Topic: Exploring PIC24 rtc_read()/rtc_write() |
jeremiah
Replies: 5
Views: 694
|
Forum: General CCS C Discussion Posted: Tue Nov 05, 2024 11:47 am Subject: Exploring PIC24 rtc_read()/rtc_write() |
The C standard doesn't have an rtc_time_t type, so I wouldn't compare them. In general, it would really come down to how the PIC implements the RTC registers as to what the time base is, so I would r ... |
Topic: Get ticks |
jeremiah
Replies: 3
Views: 882
|
Forum: General CCS C Discussion Posted: Thu Oct 17, 2024 10:48 am Subject: Get ticks |
Thanks, the manual still doesn't clearly explain how the function works. I tested it with the ICD and understand how it functions now.
I would definitely suggest you give that feedback to CCS via t ... |
Topic: Ternary/conditional operator - trouble with strings |
jeremiah
Replies: 7
Views: 1360
|
Forum: General CCS C Discussion Posted: Sun Oct 13, 2024 10:32 am Subject: Ternary/conditional operator - trouble with strings |
you might also be able to predefine string constants and just pass them into printf using "%s" and a tertiary operator to select which one is passed in. |
Topic: Confused about atol() and unsigned values |
jeremiah
Replies: 7
Views: 1370
|
Forum: General CCS C Discussion Posted: Thu Oct 10, 2024 9:30 am Subject: Re: Confused about atol() and unsigned values |
However, I don't understand why this works! atol() is supposed to return a signed int16, and looking at the internal code for atol() in stdlib.h, it definitely does all its calculations with signed ... |
Topic: Build error |
jeremiah
Replies: 4
Views: 1178
|
Forum: General CCS C Discussion Posted: Wed Oct 09, 2024 7:06 am Subject: Build error |
Thanks. It just seems odd since the include file is supplied by CCS.
Well they are human. Sometimes they make mistakes. It's easy to do when microchip is putting out so many new chips and chip va ... |
Topic: Build error |
jeremiah
Replies: 4
Views: 1178
|
Forum: General CCS C Discussion Posted: Mon Oct 07, 2024 6:18 pm Subject: Re: Build error |
I confirmed that there is an SFR named CM1CON0 so what gives?
Thanks.
Glenn
did you confirm it in the device database in CCS or in the datasheet? Sometimes the device database has errors, ... |
Topic: Preventing buffer overflow when using gets() |
jeremiah
Replies: 14
Views: 2573
|
Forum: General CCS C Discussion Posted: Tue Oct 01, 2024 8:08 am Subject: Preventing buffer overflow when using gets() |
OK.
As Jeriemiah says, you can use priorities, but these generally only change
the order the interrupts are serviced. On DsPIC's interrupts can interrupt
each other (if you enable nested interrupt ... |
Topic: Preventing buffer overflow when using gets() |
jeremiah
Replies: 14
Views: 2573
|
Forum: General CCS C Discussion Posted: Mon Sep 30, 2024 3:24 pm Subject: Preventing buffer overflow when using gets() |
Depending on the PIC you are using you can potentially set the timer interrupt to a higher priority than the serial interrupt, allowing it to interrupt the interrupt. Just don't share variables betwe ... |
Topic: Preventing buffer overflow when using gets() |
jeremiah
Replies: 14
Views: 2573
|
Forum: General CCS C Discussion Posted: Sun Sep 29, 2024 10:23 pm Subject: Preventing buffer overflow when using gets() |
Your printf takes time (lots of time) so by the time you are finished printing, the hardware buffer has filled up and overflowed, which means you just "miss" any characters that come after t ... |
Topic: PIC24 IO state initialization built-in function issues? |
jeremiah
Replies: 6
Views: 1531
|
Forum: General CCS C Discussion Posted: Tue Sep 24, 2024 3:25 pm Subject: PIC24 IO state initialization built-in function issues? |
There really shouldn't be any ASM associated with output_X and set_tris_x that hangs up. Those don't usually poll any registers (you can check your ASM to verify though). My guess is something else ... |
Topic: Compiler implements hardware Uart or not? |
jeremiah
Replies: 12
Views: 2893
|
Forum: General CCS C Discussion Posted: Wed Sep 18, 2024 1:03 pm Subject: Compiler implements hardware Uart or not? |
So is either using UART1, or specifying the pins (e.g. xmit=PIN_C6,rcv=PIN_C7), both do the same thing?
I'm guessing that specifying the pins is superfluous since you can't pick and choose the pins ... |
Topic: Compiler implements hardware Uart or not? |
jeremiah
Replies: 12
Views: 2893
|
Forum: General CCS C Discussion Posted: Wed Sep 18, 2024 9:53 am Subject: Compiler implements hardware Uart or not? |
thanx all!
#use delay(internal=8000000)
#PIN_SELECT U1RX=PIN_B7
#PIN_SELECT U1TX=PIN_B6
#use RS232(stream=debug, UART1, Baud=38400, ERRORS)
Works, but doesn't raise a warning. ... |
Topic: Total beginner - problem with printf missing characters |
jeremiah
Replies: 5
Views: 1699
|
Forum: General CCS C Discussion Posted: Wed Sep 11, 2024 6:11 pm Subject: Re: Total beginner - problem with printf missing characters |
If I use puts() instead, then it works without any problems.
gaugeguy already provided a solution, but wanted to address this part for your understanding.
the puts() function is much much qu ... |
|