Pinguino Forum

Full Version: Accessing registers/interrupts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi all,

I am not sure whether it is a bug or a user configuration issue, maybe anyone can help me.

When compiling any tutorial with the syntax like "Registername.Bits" (i.e. IFS0bits.T1IF from P32-Interrupt-Timer1.pde tutorial), I receive an error:

ERROR: C:\pinguino-11\user\source\user.c:44:5: error: 'IFS0Bits' undeclared (first use in this function)

Did the syntax change since the tutorials have been worked out?

My OS is Windows 7 with the Pinguino IDE 11.0-beta.3. It seems, that it is board independent, anyway I am intended to use the Olimex PIC32M220.

Thanks in advance,
One use b but the error shows B - is that a clue maybe?

(29-03-2015, 09:20 PM)pingotg Wrote: [ -> ]One use b but the error shows B - is that a clue maybe?


Hi John,
thx for answering. Unfortunately, it makes no difference whether I compile the code with IFS0Bits.T1IF or IFS0bits.T1IF. In both cases an user.c file will be created with IFS0Bits.T1IF.

Am I the only one, who has this problem or am I the only one who wants to program under windows? Smile

Here the stbout output:

if exist C:\pinguino-11\user\source\main32.o @del C:\pinguino-11\user\source\main32.o

if exist C:\pinguino-11\user\source\main32.elf @del C:\pinguino-11\user\source\main32.elf
if exist C:\pinguino-11\user\source\main32.hex @del C:\pinguino-11\user\source\main32.hex
if exist C:\pinguino-11\user\source\obj\non-free\processor.o @del C:\pinguino-11\user\source\obj\non-free\processor.o
C:\pinguino-11\compilers\p32\bin\p32-gcc.exe -march=m4k -EL -msoft-float -nostdlib -static -O3 -minterlink-mips16 -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,-LC:\pinguino-11\user\source\obj\non-free -Wl,--defsym,_min_heap_size=512 -Wl,-Map=C:\pinguino-11\user\source\ -D __PIC32MX__ -D __32MX220F032D__ -D PIC32_PINGUINO_220 -TC:\pinguino-11\p32\lkr\32MX220F032D.ld -TC:\pinguino-11\p32\lkr\elf32pic32mx.x -LC:\pinguino-11\user\source\obj\non-free\usb -lm -lgcc -lc -fdollars-in-identifiers -IC:\pinguino-11\p32\include\non-free -IC:\pinguino-11\p32\include\pinguino\core -IC:\pinguino-11\p32\include\pinguino\libraries -IC:\pinguino-11\p32\lkr -IC:\pinguino-11\user\examples\08.Interrupt -IC:\pinguino-11\user\source\obj\non-free -mips16 -S -o C:\pinguino-11\user\source\main32.S C:\pinguino-11\user\source\main32.c
In file included from C:\pinguino-11\user\source\define.h:3:0,
from C:\pinguino-11\user\source\main32.c:39:
C:\pinguino-11\p32\include\pinguino\libraries/cdc.c: In function 'CDC_printf':
C:\pinguino-11\p32\include\pinguino\libraries/cdc.c:451:14: warning: passing argument 1 of 'cdc_puts' from incompatible pointer type
In file included from C:\pinguino-11\p32\include\pinguino\libraries/cdc.c:90:0,
from C:\pinguino-11\user\source\define.h:3,
from C:\pinguino-11\user\source\main32.c:39:
C:\pinguino-11\p32\include\pinguino\libraries/usb/usb_function_cdc.c:299:6: note: expected 'const char *' but argument is of type 'u8 (*)[64]'
void cdc_puts(const char *buffer, u32 length)
In file included from C:\pinguino-11\user\source\main32.c:58:0:
C:\pinguino-11\user\source\user.c: In function 'Tmr1Interrupt':
C:\pinguino-11\user\source\user.c:44:5: error: 'IFS0Bits' undeclared (first use in this function)
if (IFS0Bits.T1IF)
C:\pinguino-11\user\source\user.c:44:5: note: each undeclared identifier is reported only once for each function it appears in
make: *** [compile] Error 1

Thx in advance,
You might be the only one using that file today.

(I use Linux anyway.)


Mmmmm, the 11 version of the IDE have very strange behaviours.
Today I downloaded from SVN all the zip and manually installed it on a Windows 7 64 bit machine.

I can't compile P32-Interrupt-Timer1.pde but I receive a different error message.
In my case the error message is
Quote:C:\pinguino-11\user\source\main32.o: In function `main':
(.text.startup.main+0x38): undefined reference to `CDC_printf'
collect2.exe: error: ld returned 1 exit status
make: *** [compile] Error 1

If I comment the line
CDC.printf("counter = %d\n\r",counter);
the program is compiled regularly. (an other solution is to use old CDC library take from IDE4)

There are a lot of strange behaviour.
For example, compiling MCP3422_2CH_18Bit_I2C_ADC.pde
obtain the absurd error
Quote:In file included from C:\pinguino-11\user\source\main32.c:41:0:
C:\pinguino-11\user\source\define.h:7:10: error: #include expects "FILENAME" or <FILENAME>
and so on.

Bye Bye, Moreno
Thx Moreno, this sounds that these problems are known. When is an update planned?

I would switch to Linux, if the software development stucks.Otherwise I would also report any bug I can find in order to support the developer.


I do not know if these problems are know.

IDE 11 is a development version, it require a lot of work, at the moment I use the previous version of the IDE.

Bye Bye, Moreno
There is bugs in the preprocessor of the V11 beta3.
try to update library and ide with the latest library and ide zip file avail on github. it may fix your problem (or not...)

Thank you very much Joel, I will keep you up to date.
(01-04-2015, 06:54 PM)joel Wrote: [ -> ]There is bugs in the preprocessor of the V11 beta3.
try to update library and ide with the latest library and ide zip file avail on github. it may fix your problem (or not...)


Perfect, this tutorial works (compiles) now, the code looks also much simpler:

// define here the code to execute when an interrupt occure
void Timer1Interrupt(void)
   // Check Timer1 Interrupt flag
   if (Int.getFlag(INT_TIMER1))
       // Clear the timer interrupt flag
       TMR1=0;        // reset the timer register
       counter++;        // increment the counter

If I understand this correctly:
"Int" is the library, "getFlag" is a new function, but it is clear what it does and INT_TIMER1 is the flag itself. I also saw several other interrupt flags.
Pages: 1 2 3