3 Replies Latest reply on Nov 18, 2018 5:04 PM by MoTa_728816

    Header and C files compatibility Errors

    sualc_2707881

      Hello,

       

      I need to fix these code errors in this project. Whenever I fix an error, others come up! Please see the attached project.

       

      I am trying to prepare a project to run the Fingerprint Scanner GT-521F32 on CY8CKIT-042 Pioneer Kit.

       

      Thanks,

        • 1. Re: Header and C files compatibility Errors
          XiaoweiZ_71

          PSoC4 is much easier to use with excellent IDE PSoC Creator, but transplant is  also needed, you cannot import a AVR Mega128 based project into Creator directly without changing any source code

          • 2. Re: Header and C files compatibility Errors
            sualc_2707881

            So now what to do to get these libraries work? Can anyone fix these errors?

            • 3. Re: Header and C files compatibility Errors
              MoTa_728816

              Hi,

               

              You are just importing programs written for ATMEGA2560 into a project for PSoC4.

               

              So what you need is learn the way how a project for PSoC 4 should be organized and written.

              Unless you are planning to pay someone else to write a program for you,

              I strongly recommend you to at least watch following video tutorials, it will save you a lot of time later.

              http://www.cypress.com/training/psoc-101-video-tutorial-series-how-use-arm-cortex-m0-based-psoc-4

               

              Having written that, as far as I tried with following modification(s),

              I could manage to compile your project.

               

              Note: for debug print I added "UART" and to connect with FPS

              I added "GT511C3" in the schematic and pins.

               

              =========================

              [Project]

              =====================

              remove following files from the project

              avrCommon.h

              pins.h

              usart.h

              pins.c

              usart.c

              ====================

              [FPS.h]

              comment or remove

              #include "usart.h"

              #include "pins.h"

              add

              #include "project.h"

               

              [TopDesign.cysch]

              add

              UART(SCB mode) as UART 115200 baud (for debug printf)

              UART(SCB mode) as GT511C3 9600 baud (for connecting with GT511C3)

               

              [Pins]

              FPS_rx: P4[0]

              FPS_tx: P4[1]

              UART_rx: P0[4]

              UART_tx: P0[5]

               

              in AB_STEM_init_FPS()

              comment/remove

              setDirection(AB_P0,AB_INPUT);

              setDirection(AB_P1,AB_OUTPUT);

              usartInit(AB_USART_2, AB_B_9600, AB_NONE, AB_ONE_BIT, AB_EIGHT_BIT,AB_USART_INTERRUPT_DISABLE);

              add

              GT511C3_Start() ;

               

              in SendCommand

              comment/remove

              sendUData(AB_USART_2,sendbuf,12);

              add

              GT511C3_SpiUartPutArray(sendbuf, 12);

               

              in RecvResponse

              comment/remove

              while((UCSR2A & (1<<RXC2)) == 0);  // wait while data is being received

              buf[i] = UDR2;

              add

              while(GT511C3_SpiUartGetRxBufferSize() == 0) ;

              buf[i] = GT511C3_SpiUartReadRxData() ;

               

              in RecvData

              comment/remove

              while((UCSR2A & (1<<RXC2)) == 0); // wait while data is being received

              *(data + i) = UDR2;

              add

              while(GT511C3_SpiUartGetRxBufferSize() == 0u) ; // wait while data is being received

              *(data + i) = GT511C3_SpiUartReadRxData() ;

               

              in ClearLine

              comment/remove

              while((UCSR2A) & (1<<RXC2)); // wait while data is being received

              {

                  UDR2;

              }

               

              add

              while (GT511C3_SpiUartGetRxBufferSize())

              {

                  GT511C3_SpiUartReadRxData();

              }

               

              comment/remove whole "int main()"

               

              [main.c]

              after #include "project.h"

              add

              #include <stdio.h>

              #include "FPS.h"

               

              in main()

              add where /* Place your initialization ... */

              UART_Start() ;

               

              port other staff in the main() in FPS.c

               

              refer to the attached project

              =========================

               

              At least the project is "compile-able", but as I don't have GT511C3 module

              I can not confirm if it works or not.

               

              moto