1
vote
1answer
47 views

Get bytes from a short long in C18

I'm using the C18 compiler and need to get the three bytes of a short long from MSB to LSB. I'd say I could use this: ...
3
votes
1answer
72 views

Integers >9999 in PIC C18

In this answer, I made a function to convert an integer to an ASCII string: ...
5
votes
5answers
290 views

Integer to ASCII in C18

I'm writing code for a PIC18F46K22 using the C18 compiler. I want to write the value of an integer \$n\$ in ASCII over the USART to my PC. For \$n<10\$, it's easy: ...
3
votes
3answers
224 views

Can I pass a bit register as a function argument in Hi-Tech C compiler for PIC16?

Is there a way to pass a bit from a PIC's register as a function parameter? Taking, for example, the PIC16F887, its registers (SFRs) and individual bits are defined as fallows in the corresponding ...
6
votes
3answers
272 views

Extraneous loop produced by PIC compiler from MicroChip

We're using the Lite version of the MicroChip PIC compiler so maybe that's the reason, but this simple one-bit shift is generating a loop where none is necessary. Since the shift count is 1 (a ...
0
votes
1answer
150 views
6
votes
3answers
380 views

What does #if 0 do

Today I started to use MPLAB X to program my PICs, and found a code template, with multiple files and spots to fill in code. Before I have had a single file with my code in it. In this template, where ...
0
votes
1answer
202 views

Mac based AVR development issue

Ok, so I reinstalled my development enviroment on the mac using the latest build of avr-gcc (4.4.2), avr-libc and avrdude from the Fink project. Problem is when compiling I keep on getting a linker ...
4
votes
3answers
714 views

Usage of the #pragma pack(1) compiler directive on embedded applications

I have recently come across this #pragma pack(1) preprocessor directive and was wondering why it is being used? I Googled the usage, and found it has other options such as push,pop etc. Has anyone ...
4
votes
4answers
1k views

What PIC24 C compilers are out there, and what is your opinion or review on them?

Specifically, the PIC24 series. I tried out microchips C30 compiler, but it seems to be a bit too complicated for me, and I couldn't find any libraries with it. Then I tried CCS, and it seems far ...