Author |
Message |
Topic: char array shows too many bits per char |
KTrenholm
Replies: 13
Views: 22233
|
Forum: General CCS C Discussion Posted: Wed Jan 06, 2016 3:34 pm Subject: char array shows too many bits per char |
It's still 0xEF. It's likely promoting it to a signed 16-bit value, which is 0xFFEF.
Try doing the following, shown in bold below:
if (rs232MsgInBuff2(int8)0xEF){
}
I don't have PCD so I can' ... |
Topic: char array shows too many bits per char |
KTrenholm
Replies: 13
Views: 22233
|
Forum: General CCS C Discussion Posted: Wed Jan 06, 2016 2:14 pm Subject: char array shows too many bits per char |
1) I'm on a PIC24FV32KA302
2) I am on an older CCS version V4.132
What about this item in the CCS versions list ?
4.141 Various chip specific built in functions fixes have been made
4.141 ... |
Topic: char array shows too many bits per char |
KTrenholm
Replies: 13
Views: 22233
|
Forum: General CCS C Discussion Posted: Wed Jan 06, 2016 1:35 pm Subject: char array shows too many bits per char |
/*Globals*/
#define BUFFER_DATA_SIZE 25
unsigned int8 rs232MsgInBuff[BUFFER_DATA_SIZE]; // change 1
unsigned int8 rs232MsgInBuff2[BUFFER_DATA_SIZE]; // change 2 - do these fi ... |
Topic: char array shows too many bits per char |
KTrenholm
Replies: 13
Views: 22233
|
Forum: General CCS C Discussion Posted: Wed Jan 06, 2016 12:54 pm Subject: char array shows too many bits per char |
EDIT: That said, if you aren't going to be sending exclusively ascii (values less than 0x80), then you should probably make your arrays unsigned chars instead of signed chars.
You might have som ... |
Topic: char array shows too many bits per char |
KTrenholm
Replies: 13
Views: 22233
|
Forum: General CCS C Discussion Posted: Wed Jan 06, 2016 12:53 pm Subject: char array shows too many bits per char |
The pic24 series is a 16bit chip (hence the sign extension to FFEF...while leading zeros are defaulted to discarded so 0030 shows up as just 30). Try %02X instead and see if that keeps it down to 2 ... |
Topic: char array shows too many bits per char |
KTrenholm
Replies: 13
Views: 22233
|
Forum: General CCS C Discussion Posted: Wed Jan 06, 2016 12:42 pm Subject: char array shows too many bits per char |
Also, you should have told us the following in your post:
1. Your PIC.
2. Your CCS compiler version.
3. Name of your terminal program
4. #use rs232 statement.
5. Preferably a full test p ... |
Topic: char array shows too many bits per char |
KTrenholm
Replies: 13
Views: 22233
|
Forum: General CCS C Discussion Posted: Wed Jan 06, 2016 12:04 pm Subject: char array shows too many bits per char |
Hi All,
I've got a strange issue with (possibly?) typing and I'm hoping I can have some light shed on it. I'm finding that my char array I'm using to process serial is showing extra bits for certa ... |
Topic: Reproducing a CCS convenience function in XC16? |
KTrenholm
Replies: 2
Views: 7213
|
Forum: General CCS C Discussion Posted: Fri Sep 05, 2014 12:33 pm Subject: Reproducing a CCS convenience function in XC16? |
Okay I resolved my issues I was having. The issue was in the layout of my ISR. The function I posted does seem to be a suitable port of the convenience function.
However I did turn the I2C_ISR_St ... |
Topic: Reproducing a CCS convenience function in XC16? |
KTrenholm
Replies: 2
Views: 7213
|
Forum: General CCS C Discussion Posted: Fri Sep 05, 2014 10:04 am Subject: Reproducing a CCS convenience function in XC16? |
Hi all,
I've got an interesting situation on my hands and I'm hoping someone here might be familiar enough with the CCS built in functions to shed some light on it.
I'm working on some I2C code ... |
Topic: Handling RS232 errors from incorrect baud rates |
KTrenholm
Replies: 11
Views: 19918
|
Forum: General CCS C Discussion Posted: Tue Aug 26, 2014 8:27 am Subject: Handling RS232 errors from incorrect baud rates |
Problem is that it won't do a getc, unless kbhit is set. Now the getc, is what triggers the error clearing code. As such there is the potential to sit looping, depending on how the CCS code sets thing ... |
Topic: Handling RS232 errors from incorrect baud rates |
KTrenholm
Replies: 11
Views: 19918
|
Forum: General CCS C Discussion Posted: Tue Aug 26, 2014 8:03 am Subject: Handling RS232 errors from incorrect baud rates |
heh, as far at the fast IO is concerned, I have no idea why that's there. I inherited a bunch of PIC code that all have their RDA ISRs configured in this way and the way the guy did things I'm decent ... |
Topic: Handling RS232 errors from incorrect baud rates |
KTrenholm
Replies: 11
Views: 19918
|
Forum: General CCS C Discussion Posted: Tue Aug 26, 2014 7:02 am Subject: Handling RS232 errors from incorrect baud rates |
Also, realise that the RDA interrupt means _one_ character is ready to be read. The ISR should read just this character. Look at ex_sisr.
As it stands _your_ handler could receive hundreds of charact ... |
Topic: Handling RS232 errors from incorrect baud rates |
KTrenholm
Replies: 11
Views: 19918
|
Forum: General CCS C Discussion Posted: Mon Aug 25, 2014 2:50 pm Subject: Handling RS232 errors from incorrect baud rates |
Hi all,
I've got a bit of a strange situation that I'm not entirely sure how to handle.
I am using PCWHD v4.132
the PIC is a PIC24FV32KA304
What I'm looking to do is to "protect" my ... |
Topic: I2C Uneven SCL Pulses |
KTrenholm
Replies: 10
Views: 12782
|
Forum: General CCS C Discussion Posted: Wed Jul 02, 2014 7:22 am Subject: I2C Uneven SCL Pulses |
As some comments:
1) You are setting up streams in the I2C setup, but not then using this. Stick with either:
a) Use streams throughout - so the I2C write should also be using a stream name, or
... |
Topic: I2C Uneven SCL Pulses |
KTrenholm
Replies: 10
Views: 12782
|
Forum: General CCS C Discussion Posted: Tue Jul 01, 2014 12:54 pm Subject: I2C Uneven SCL Pulses |
Look at the .LST file to see if the compiler is using software i2c.
For 18F PICs, this thread shows what the ASM code will look like:
http://www.ccsinfo.com/forum/viewtopic.php?t=31547&highlight ... |
|