Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino IDE V12: I2C library bug
26-07-2017, 02:50 PM,
#1
Pinguino IDE V12: I2C library bug
Hello everyone,

I am working in an application library for the MAX30100 (Pulse Oximeter and Heart-Rate Sensor IC for Wearable Health). The communication bus that uses the integrated circuit is the I2C, so choose to use the library included in Pinguino IDE V12.
As a hardware I am using the Pinguino P8 board based on the PIC18F4550.
Unfortunately the I2C library does not seem to work. Both compilers, SDCC and XC8, throw errors when trying to compile. Attached below is a capture of the stdout.

Code:
2017-07-26 09:43:36.382000
######################################################################
Processor: 18f4550
sdcc: Calling preprocessor...
sdcc: sdcpp.exe -nostdinc -Wall -std=c11 -D"PINGUINO4550" -D"boot4" -D"BOARD=\"PINGUINO4550\"" -D"PROC=\"18f4550\"" -D"BOOT_VER=4" -I"C:\Program Files\Pinguino\v12\p8\include\pinguino\core" -I"C:\Program Files\Pinguino\v12\p8\include\pinguino\libraries" -I"C:/Users/Leonardo/Documents/Pinguino/v12/Programas/SPO2" -D__18f4550 -D__SDCC_PIC18F4550 -D__STACK_MODEL_SMALL -obj-ext=.o -D__SDCC_CHAR_UNSIGNED -D__SDCC_USE_NON_FREE -D__SDCC_ALL_CALLEE_SAVES -D__SDCC=3_5_5 -D__SDCC_VERSION_MAJOR=3 -D__SDCC_VERSION_MINOR=5 -D__SDCC_VERSION_PATCH=5 -DSDCC=355 -D__SDCC_REVISION=9516 -D__SDCC_pic16 -D__STDC_NO_COMPLEX__=1 -D__STDC_NO_THREADS__=1 -D__STDC_NO_ATOMICS__=1 -D__STDC_NO_VLA__=1 -D__STDC_ISO_10646__=201409L -D__STDC_UTF_16__=1 -D__STDC_UTF_32__=1 -isystem "C:\Program Files\Pinguino\p8\bin\..\share\sdcc\include\pic16" -isystem "C:\Program Files\Pinguino\p8\bin\..\share\sdcc\include" -isystem "C:\Program Files\Pinguino\p8\bin\..\share\sdcc\non-free\include\pic16" -isystem "C:\Program Files\Pinguino\p8\bin\..\share\sdcc\non-free\include"  "C:\Users\Leonardo\Documents\Pinguino\v12\source\main.c"
sdcc: Generating code...
/dvpt/pinguino/git-copy/pinguino-compilers/sources/sdcc/src/pic16/main.c:697 setting interrupt vector addresses 0xc00
C:/Program Files/Pinguino/v12/p8/include/pinguino/libraries/printFormated.c:198: warning 85: in function pprinti unreferenced function argument : 'separator'
C:/Program Files/Pinguino/v12/p8/include/pinguino/libraries/printFormated.c:382: warning 85: in function pprintfl unreferenced function argument : 'separator'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:32: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:32: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:33: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:33: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:36: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:36: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:37: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:37: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:37: error 47: indirections to different types assignment  
from type 'void'
 to type 'unsigned-char fixed'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:42: error 102: too few parameters
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:47: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:47: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:48: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:48: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:51: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:51: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:52: error 20: Undefined identifier 'I2C'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:52: error 25: Structure/Union expected left of '.->'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:52: error 47: indirections to different types assignment  
from type 'void'
 to type 'unsigned-char fixed'
C:\Users\Leonardo\Documents\Pinguino\v12\source\/user.c:57: error 102: too few parameters

I also attached the program files used, in case anyone wants to replicate the compilation test.

I have tested the examples included in the Pinguino IDE and all throw compilation error, none works.

Did someone have the same problem?

Could someone help me with this problem.

Thanks.
Regards,

Leonardo Alvarez


Attached Files
.h   MAX30100.h (Size: 2.78 KB / Downloads: 2)
.pde   MAX30100_Ejemplo.pde (Size: 2.96 KB / Downloads: 3)
Reply
27-07-2017, 04:36 PM,
#2
RE: Pinguino IDE V12: I2C library bug
Hello everyone,

I think I found the problem. In the .pdl file the I2C.write definition no longer exists, instead it is defined I2C.writeChar. This change is not documented, nor updated in the examples that come with the Pinguino IDE.
I made the changes and now compiles. I will test on hardware to prove that the problem is solved, and close this thread.
I hope this contribution serves to update the examples, review the definitions and changes, and document them. I use the tools of the penguin project to teach programming, robotics and electronics to high school students, and these types of changes generate a problem for the students' development. Programs and libraries that previously worked, no longer do, examples either, and they lose reference.

I attach the corrected files used.

Thank you.

Regards,

Leonardo.


Attached Files
.h   MAX30100.h (Size: 2.78 KB / Downloads: 2)
.pde   MAX30100_Ejemplo.pde (Size: 3.02 KB / Downloads: 2)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)