Hello everyone,
I've downloaded an example for communication between two transceivers and its communication for a PIC microcontroller
and after doing some changes i've found out that some functions were missing (SPI1_WRITE,SPI1_READ).
I attach the link to the code:
https://libstock.mikroe.com/projects/vi ... ck-example
Can u help me?
Thanks in advanced.
Bee click module
Re: Bee click module
I've seen that the problem is that i don´t have the SPI library. Could you please provide it to me?
Thank you.
Thank you.
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: Bee click module
Hi,
I believe I have answered you on the ticket,
so I suggest to continue our correspondence there.
Kind regards,
Lana
I believe I have answered you on the ticket,
so I suggest to continue our correspondence there.
Kind regards,
Lana
Re: Bee click module
I've started to write the communication to interface PIC24FJ1024GB610 to the click module. However,
I'm not setting up the SPI module properly because always obtained '0' from reading a register.
I think the problem is related with the clk bus. PIC works at a frequency of 8MHz and Bee click
at 100KHz (selectable). Ideas?
I'm not setting up the SPI module properly because always obtained '0' from reading a register.
I think the problem is related with the clk bus. PIC works at a frequency of 8MHz and Bee click
at 100KHz (selectable). Ideas?
Code: Select all
void SPI1_set_control(){
IEC0bits.SPI1IE = 0; /* dISABLE Interrupt Enable bit */
SPI1CON1Lbits.SPIEN=0;//DISABLE spi MODULE
SPI1BUFL=0; //CLEAR BUFFER
SPI1CON1Lbits.ENHBUF=0; //disable enhanced buffer mode
IFS0bits.SPI1IF = 0; /* Clear IF bit */
IPC2bits.SPI1IP = (0x0007); /* Assign interrupt priority */
IEC0bits.SPI1IE = 1; /* Interrupt Enable bit */
SPI1BRGL=0x0002;
//pic24fj1024gb610 clock is 8MHz
//Bee click clock is 100khz
//CLKDIVbits.DOZEN=0;
//CLKDIVbits.DOZE=010;//divide clock by by 128???
SPI1CON1Hbits.AUDEN=0; Audio protocol disabled
SPI1CON1Lbits.SPISIDL=0; Continues to operate in CPU Idle mode
SPI1CON1Lbits.DISSDO=0; //SDO controlled by the module
SPI1CON1Lbits.MODE=00; //8 bit mode
SPI1CON1Lbits.SMP=0; //Input data is sampled at the middle of data output time
SPI1CON1Lbits.CKE=0; //TX from idle clock state to active clock state
SPI1CON1Lbits.SSEN=0; //controlled by I/O
SPI1CON1Lbits.CKP=0; //idle state for clock is low level
SPI1CON1Lbits.DISSDI=0; //SDI controlled by the module
SPI1CON1Lbits.MSTEN=1; //master enable
SPI1CON1Lbits.SPIEN=1; //spi enable
}
}
- lana.arsic
- mikroElektronika team
- Posts: 1715
- Joined: 15 Jan 2016 12:50
Re: Bee click module
Hi,
Can you tell me which compiler are you using?
Unfortunately, at this moment, our compilers for dsPIC don't support
PIC24FJ1024GB610, but I will suggest to our developers to add support.
Regarding setting SPI registers, you can take a look at the link bellow:
http://ww1.microchip.com/downloads/en/D ... 05136a.pdf
Kind regards,
Lana
Can you tell me which compiler are you using?
Unfortunately, at this moment, our compilers for dsPIC don't support
PIC24FJ1024GB610, but I will suggest to our developers to add support.
Regarding setting SPI registers, you can take a look at the link bellow:
http://ww1.microchip.com/downloads/en/D ... 05136a.pdf
Kind regards,
Lana