Hi,
Now i use a PIC18F26K40 to pilot with the SPI bus a 8x7segs with Maxim 7219 driver.
With Software_SPI library all work fine.
With SPI_Remappable library nothing append. With a scope on SDO or CLK no signal appeared ?
Is this library working with 18F26K40 ?
Please, do you have a mostly recently sample of SPI program for mikroBasic Pro ?
Thank in advance and Happy Holidays
PB with SPI with 18F26K40
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PB with SPI with 18F26K40
Hello,
The PPS Lock bit in config has to be set to Allow multiple reconfigurations.
Also, you need to map Serial Clock as input and output.
Can you zip and send me your project for review?
Kind regards,
Jovana
The PPS Lock bit in config has to be set to Allow multiple reconfigurations.
Also, you need to map Serial Clock as input and output.
Can you zip and send me your project for review?
Kind regards,
Jovana
-
- Posts: 12
- Joined: 04 Dec 2010 13:27
Re: PB with SPI with 18F26K40
Hi,
I modify PPS lock bit to multiple reconfiguration but no result.
You can find the project in file attachment.
Regards,
Christophe
I modify PPS lock bit to multiple reconfiguration but no result.
You can find the project in file attachment.
Regards,
Christophe
- Attachments
-
- Max7219.rar
- 8x7segs project
- (43.34 KiB) Downloaded 83 times
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PB with SPI with 18F26K40
Hi Christophe,
I apologize for the delayed answer.
In the attachment, you can find the corrected project. Let me know if it works.
Kind regards,
Jovana
I apologize for the delayed answer.
In the attachment, you can find the corrected project. Let me know if it works.
Kind regards,
Jovana
- Attachments
-
- Max7219.zip
- (63.46 KiB) Downloaded 87 times
-
- Posts: 12
- Joined: 04 Dec 2010 13:27
Re: PB with SPI with 18F26K40
Hi Jovana,
Thank you for your time.
I am disapointed because the code not working and i would like to solve my problem.
All segments are light on but nothing append after reboot. After i am trying the softcode and all working fine ?
Regards
Christophe
Thank you for your time.
I am disapointed because the code not working and i would like to solve my problem.
All segments are light on but nothing append after reboot. After i am trying the softcode and all working fine ?
Regards
Christophe
-
- Posts: 12
- Joined: 04 Dec 2010 13:27
Re: PB with SPI with 18F26K40
Hi,
Now all is working fine.
Solution :
1) PPS define need to be change because SPI output is RC4.
2) Clock to manage SPI need to be : FOSC/64.
Last question before close this subject : Can you send me an update of PPS library with correct input and output constant value to those contained in your response (constant like _SDO1_SDA1, _SCK1_SCL1; ...)
Many thanks.
Christophe
Now all is working fine.
Solution :
1) PPS define need to be change because SPI output is RC4.
2) Clock to manage SPI need to be : FOSC/64.
Last question before close this subject : Can you send me an update of PPS library with correct input and output constant value to those contained in your response (constant like _SDO1_SDA1, _SCK1_SCL1; ...)
Many thanks.
Christophe
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PB with SPI with 18F26K40
Hello,
Can you tell me which version of the compiler you are using?
On the following link, you can find the latest version where you should have these constants:
https://download.mikroe.com/setups/comp ... p-v760.zip
Kind regards,
Jovana
Can you tell me which version of the compiler you are using?
On the following link, you can find the latest version where you should have these constants:
https://download.mikroe.com/setups/comp ... p-v760.zip
Kind regards,
Jovana
-
- Posts: 12
- Joined: 04 Dec 2010 13:27
Re: PB with SPI with 18F26K40
Hi,
I am using PICBASIC Version 7.6
Regards,
Christophe
I am using PICBASIC Version 7.6
Regards,
Christophe
-
- Posts: 12
- Joined: 04 Dec 2010 13:27
Re: PB with SPI with 18F26K40
Hi Jovana,
Now, i use PIC18F27K42 instead of PIC18F26K40 and i would like to run the same program but i have a problem with PPS output mapping. I have no problem for INPUT mapping.
I hope mapping my SPI module like this :
Unlock_IOLOCK()
PPS_Mapping(_RC3, _OUTPUT, ?SCK?)
PPS_Mapping(_RC2, _INPUT, SPI1SDIPPS)
PPS_Mapping(_RC4, _OUTPUT, ?SDO?)
Lock_IOLOCK()
Can you help me ?
Regards
Christophe
Now, i use PIC18F27K42 instead of PIC18F26K40 and i would like to run the same program but i have a problem with PPS output mapping. I have no problem for INPUT mapping.
I hope mapping my SPI module like this :
Unlock_IOLOCK()
PPS_Mapping(_RC3, _OUTPUT, ?SCK?)
PPS_Mapping(_RC2, _INPUT, SPI1SDIPPS)
PPS_Mapping(_RC4, _OUTPUT, ?SDO?)
Lock_IOLOCK()
Can you help me ?
Regards
Christophe
-
- Posts: 12
- Joined: 04 Dec 2010 13:27
Re: PB with SPI with 18F26K40
Hi Jovana,
This morning with clear ideas, I found the information I was looking for:
Unlock_IOLOCK ()
RC3PPS =% 011110 'SCK
RC4PPS =% 011111 'SDO
PPS_Mapping (_RC2, _INPUT, SPI1SDIPPS)
Lock_IOLOCK ()
Sorry for the inconvenience
Regards
Christophe
This morning with clear ideas, I found the information I was looking for:
Unlock_IOLOCK ()
RC3PPS =% 011110 'SCK
RC4PPS =% 011111 'SDO
PPS_Mapping (_RC2, _INPUT, SPI1SDIPPS)
Lock_IOLOCK ()
Sorry for the inconvenience
Regards
Christophe
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PB with SPI with 18F26K40
Hello,
You also can try on this way:
Unlock_IOLOCK()
PPS_Mapping(_RC3, _OUTPUT, _SCK1)
PPS_Mapping(_RC2, _INPUT, _SDI1)
PPS_Mapping(_RC4, _OUTPUT, _SDO1)
Lock_IOLOCK()
Kind regards,
Jovana
You also can try on this way:
Unlock_IOLOCK()
PPS_Mapping(_RC3, _OUTPUT, _SCK1)
PPS_Mapping(_RC2, _INPUT, _SDI1)
PPS_Mapping(_RC4, _OUTPUT, _SDO1)
Lock_IOLOCK()
Kind regards,
Jovana
-
- Posts: 12
- Joined: 04 Dec 2010 13:27
Re: PB with SPI with 18F26K40
Hi Jovana,
Yes, it is more simple like this !
Thanks, have a good day
Christophe
Yes, it is more simple like this !
Thanks, have a good day
Christophe