Author |
Message |
Topic: Signed number manipulation |
OldGuy
Replies: 10
Views: 23523
|
Forum: General CCS C Discussion Posted: Sat Oct 17, 2020 1:51 pm Subject: Signed number manipulation |
With the union approach, the values are read the first time into a merged word, so it eliminates the need to do a make16 or any moves entirely. It can be read out of the original location with no nee ... |
Topic: Signed number manipulation |
OldGuy
Replies: 10
Views: 23523
|
Forum: General CCS C Discussion Posted: Sat Oct 17, 2020 12:43 pm Subject: Signed number manipulation |
I switched to the union code, and it works well! Thanks for the education in unions. I can see how it is very efficient. |
Topic: Signed number manipulation |
OldGuy
Replies: 10
Views: 23523
|
Forum: General CCS C Discussion Posted: Sat Oct 17, 2020 10:34 am Subject: Signed number manipulation |
Oops, I credited the wrong person - Ttelmah was the solver. |
Topic: Signed number manipulation |
OldGuy
Replies: 10
Views: 23523
|
Forum: General CCS C Discussion Posted: Sat Oct 17, 2020 10:12 am Subject: Got it! |
Thanks so much for the responses, much appreciated.
I've learned a few things - didn't know about the make16 function, nor how to deal with unions in a case like this.
You nailed the errors, tem ... |
Topic: Signed number manipulation |
OldGuy
Replies: 10
Views: 23523
|
Forum: General CCS C Discussion Posted: Fri Oct 16, 2020 4:20 pm Subject: Signed number manipulation |
Hello -
I am talking to an I2C device that returns a 12 bit 2s-complement number. It is read as the high byte in one location, and the low byte in another. The low byte has the data in the upper ... |
Topic: 2 RS232, how to handle I/O |
OldGuy
Replies: 11
Views: 25631
|
Forum: General CCS C Discussion Posted: Sat Aug 22, 2020 7:31 am Subject: 2 RS232, how to handle I/O |
Thanks for the tips Ttelmah. Makes sense. |
Topic: 2 RS232, how to handle I/O |
OldGuy
Replies: 11
Views: 25631
|
Forum: General CCS C Discussion Posted: Fri Aug 21, 2020 7:57 pm Subject: Got it! |
I found that by switching to INT_RDA2 it works with the following code. I may have missed this working earlier, if I forgot to unplug the ICD-U64. It also wants to use the same line as incoming RS23 ... |
Topic: 2 RS232, how to handle I/O |
OldGuy
Replies: 11
Views: 25631
|
Forum: General CCS C Discussion Posted: Fri Aug 21, 2020 7:13 pm Subject: 2 RS232, how to handle I/O |
Here's the current program...
#include <18F25K80.h> // this also does the #device PIC18F25K0
// the fuses specify use of external 16 MHz oscillator
#use delay (clock=16MHZ ... |
Topic: 2 RS232, how to handle I/O |
OldGuy
Replies: 11
Views: 25631
|
Forum: General CCS C Discussion Posted: Fri Aug 21, 2020 7:07 pm Subject: 2 RS232, how to handle I/O |
I fixed that erroneous call bgetc, still no luck after changing it to getc(XBEE) or fgetc(XBEE). On another device I've done with a different PIC it works fine with getc(). |
Topic: 2 RS232, how to handle I/O |
OldGuy
Replies: 11
Views: 25631
|
Forum: General CCS C Discussion Posted: Fri Aug 21, 2020 6:15 pm Subject: 2 RS232, how to handle I/O |
Thanks for your tired thoughts Jay.
So RDA is EUSART 1 and RDA2 is EUSART 2? Defined by the pin numbers in the Use RS232?
That would make sense, and be easy to accommodate if I can figure out ... |
Topic: 2 RS232, how to handle I/O |
OldGuy
Replies: 11
Views: 25631
|
Forum: General CCS C Discussion Posted: Fri Aug 21, 2020 5:24 pm Subject: 2 RS232, how to handle I/O |
Hi - On my project, I have two RS232 streams going on at once. Well, at the moment none of them are going on at once. This is a PIC18F25K80, with both streams connected to hardware EUSART pins. At ... |
Topic: 18F25K80 Timer/RS-232 off by factors of four |
OldGuy
Replies: 23
Views: 43904
|
Forum: General CCS C Discussion Posted: Tue Aug 11, 2020 11:27 am Subject: Success! |
I removed the the S2 Digi XBEE modules and replaced them with S2C DigiMesh modules, and it works perfectly!
Many thanks to your help in getting to this point. I've learned a lot!
- Brian |
Topic: 18F25K80 Timer/RS-232 off by factors of four |
OldGuy
Replies: 23
Views: 43904
|
Forum: General CCS C Discussion Posted: Tue Aug 11, 2020 8:44 am Subject: 18F25K80 Timer/RS-232 off by factors of four |
I think I'm on to something.
I've got these two PCBs communicating via RS232 going through XBEE transceivers, different PICs on each side. The XBEE modules which should be transparent. The RS23 ... |
Topic: 18F25K80 Timer/RS-232 off by factors of four |
OldGuy
Replies: 23
Views: 43904
|
Forum: General CCS C Discussion Posted: Mon Aug 10, 2020 8:24 pm Subject: 18F25K80 Timer/RS-232 off by factors of four |
Gaugeguy -
I did the best I could measuring baud on both sides with my scope, and they were very close, both 104uS plus or minus a tick. With the UESART allowing up to 3% correction, should be g ... |
Topic: 18F25K80 Timer/RS-232 off by factors of four |
OldGuy
Replies: 23
Views: 43904
|
Forum: General CCS C Discussion Posted: Mon Aug 10, 2020 12:40 pm Subject: 18F25K80 Timer/RS-232 off by factors of four |
Thanks Ttelmah.
I found that example, used it in my program, and seems to work well.
But it shares the same problem as I was having when using receive_buffer, I was hoping it would clear up th ... |
|