int is probably a 16 bit wide signed type, range - 32768 to 32767. 40000 thus equals -25536, which is immediately < 0, so your outer loop is never entered. Again, if you only tell us that something is wrong, we can only guess. What did you expect to happen (some led toggles every 40 seconds), what did you observe instead (the led is continuously on but only dim)? You may also be lacking __asm nop __endasm in the body of your inner loop to prevent the compiler from optimizing the loop away (it has...
Hi, unless I missed something, your request for help lacks relevant information - such as the (stripped down) source code, the intended behavior, the observed behavior, whether you obtain a flashable .hex (or, in your case, .sys) file, and what exactly "is not working". From the earlier posts in this topic, I'd conclude that the warnings are harmless (but that assumption may be wrong already). Kind regards, Raphael
Somewhere in the (non-free) include/pic16 directory, there should be a file pic16devices.txt which lists (among other things) the addresses of the configuration words... Or was that for pic14? If such a file exists, you can try fixing the addresses in there for the relevant (family) record. If I can manage, I'll try and post more useful instructions.
Your first attempt seems to lack semi-colons at the end of the code char at()... lines. code and at (like all non-standard keywords) have been superseeded by variants prefixed with double underscores: __code and __at(). Including pic16 (sixteen) stdint.h seems like an unintended hack. It may work (since stdint.h only defines types and stuff that are identically useful on both pic14 and pic16), but I'd generally advise against doing it. If pic14 does not have one, rather copy a suitable stdint.h to...
Your first attempt seems to lack semi-colons at the end of the code char at()... lines. code and at (like all non-standard keywords) have been superseeded by variants prefixed with double underscores: __code and __at(). Including pic16 (sixteen) stdint.h seems like an unintended hack. It may work (since stdint.h only defines types and stuff that are identically useful on both pic14 and pic16), but I'd generally advise against doing it. If pic14 does not have one, rather copy a suitable stdint.h to...
Greetings, I hope that this is the correct place to post this issue. If not, please forgive. I am using the SDCC-toolchain 2.0.5 in MPLABx 4.01 for PIC16F1826. When I set the memory views in MPLAB X. The following is generated: * // PIC16F1826 Configuration Bit Settings // 'C' source line config statements code char at CONFIG1 CONFIG1 = FOSC_INTOSC & WDTE_OFF & PWRTE_OFF & MCLRE_ON & CP_OFF & CPD_OFF & BOREN_ON & CLKOUTEN_OFF & IESO_OFF & FCMEN_OFF code char at CONFIG2 CONFIG2 = WRT_OFF & PLLEN_OFF...
Hi, Generally, the linker should ignore object files that provide only unused symbols. If you implement your potentially unused functions in separate .c files and link your binary (not by #include'ing the .c files into one compilation unit, but by using the linker) from the resulting .rel or .obj or .o files, unused files (and thus functions) should be ignored. Reportedly, some linkers unconditionally include all object files given on the command line - so you may have to collect them into a library...
PIC memory is split into banks of 256 bytes by default. Your arrays do not fit into one of these banks, so the linker fails. You can either split your arrays into chunks no more than 256 bytes or modify the linker script to yield larger regions. The latter requires great care: If the linker puts anything but an array (or a struct), say a uint32 across the bank boundary, that would be hidden by the enlarged section, access to the data may not work correctly. This is because sdcc assumes that all bytes...
Of course: Added square brackets around hashes to stop silly formatting.. #pragma...
You may need to manually link with libc18f to get the implementation of the requested...
I believe I have a fix for all the reported issues: - useless MOVFF x,x removed (in...
[PIC16] BANKSEL generation incorrect, useless MOVFFs generated
Hi, What is the exact error message (copy and paste sdcc command line and all messages...
I am getting “undefined identifier bVID_L” from SDCC in the following code. It seems...
See manual section 3.17, #pragma preproc_asm +
See manual section 3.17, #pragma preproc_asm +
Hi, would /* defines */ #define TIMER_FREQ 200UL #define MSEC_TO_TIMER(x) ( TIMER_FREQ...
laptop sony vaio I-5 sdcc 3.4.0 x64 gputils 1.4.0 mplab x v 2.35 I am trying to compile...
I vaguely remember that sdcc exits with non-zero exit code after emitting (some,...
I vaguely remember that sdcc exits with non-zero exit code after emitting (some,...
add.h: # ifndef addguard # define addguard extern unsigned char myvar; unsigned char...
I bet you are not only declaring objects (variables, config bits) in the header but...
I bet you are not only declaring objects (variables, config bits) in the header but...
Hi there, I'm using SDCC with codeblocks for development. I've written a very small...
The Debian packages do not include the pic stuff because they are considered non-free....
The Debian packages do not include the pic stuff because they are considered non-free....
The Debian packages do not include the pic stuff because they are considered non-free....
GPLINK crashes -- this is probably the wrong forum; that would be gputils.sf.net....
GPLINK crashes -- this is probably the wrong forum; that would be gputils.sf.net....
I did not mean to imply that the errors you already see originate in your code. The...
Hello im using only linux, VIM and makefile, My test1.c is : #define __16f88 #include...
sdcc -mpic14 -p16f88 --use-non-free test1.c should do what you need. Toggling the...
I'm sorry to inform you that the C standard library is basically not available for...
I wrote two lines to test this function include <pic16f877a.h> include <stdlib.h>...
There is only the float variant atan2f() available; double support is probably not...
When you allow main to return, the PIC will experience a call-stack underflow and...
You want __code int __at(0x2007) cfg0 = 0x2104; __code int __at(0x2007) declares...
Hi, it would help to state what exactly does not work (compilation errors? runtime...
Hi, it would help to state * what exactly does not work (compilation errors? runtime...
Hi, it would help to state, what exactly does not work (compilation errors? runtime...
Hmmm, I don't know. Would #0x41 work for you/the assembler? Replacing $<hexit><hexit>...
Did you try replacing $41 with plain 41 or #41? I have no clue regarding z80 assembler,...
Support for PIC16 targets (18fxxx, 18fxxxx) is in much better shape both regarding...
Hi, strangely, I am sure that I had posted another comment on this one, but for some...
Hi, strangely, I am sure that I had posted another comment on this one, but for some...
Yes, that is indeed the reason. If Debian does not have the non-free parts (they...
You may need to install sdcc-nonfree as well (if that exists) or build sdcc from...
Oh, this is sad news indeed. My sincere condolences to Borut's family. Borut has...
Unless i am mistaken, SDCC 3.3 does no longer have inc2h.pl for PIC (neither the...