18F26K20 SD Testing
Moderators: David Barker, Jerry Messina
18F26K20 SD Testing
Steven,
I was wondering if you have tried using the SD Library with the 18F26K20. I tried doing so a little while back and didn't have much luck. Maverick pinged me the other day and I would like to revisit this, but before I did I wanted to touch base with you on this.
I was wondering if you have tried using the SD Library with the 18F26K20. I tried doing so a little while back and didn't have much luck. Maverick pinged me the other day and I would like to revisit this, but before I did I wanted to touch base with you on this.
Steven, it looks like they are the same
18F2620 - http://ww1.microchip.com/downloads/en/D ... 39626e.pdf
18F2620 - http://ww1.microchip.com/downloads/en/D ... 39626e.pdf
18F26K20 - http://ww1.microchip.com/downloads/en/D ... 80404A.pdf17.3.1 REGISTERS
The MSSP module has four registers for SPI mode
operation. These are:
• MSSP Control Register 1 (SSPCON1)
• MSSP Status Register (SSPSTAT)
• Serial Receive/Transmit Buffer Register
(SSPBUF)
• MSSP Shift Register (SSPSR) – Not directly
accessible
SSPCON1 and SSPSTAT are the control and status
registers in SPI mode operation. The SSPCON1 register
is readable and writable. The lower 6 bits of the
SSPSTAT are read-only. The upper two bits of the
SSPSTAT are read/write.
SSPSR is the shift register used for shifting data in or
out. SSPBUF is the buffer register to which data bytes
are written to or read from.
In receive operations, SSPSR and SSPBUF together
create a double-buffered receiver. When SSPSR
receives a complete byte, it is transferred to SSPBUF
and the SSPIF interrupt is set.
During transmission, the SSPBUF is not doublebuffered.
A write to SSPBUF will write to both SSPBUF
and SSPSR.
ERRATA Check - Steven I purchased these units in July and it looks like there might some issues with the MSSP module on these. - http://ww1.microchip.com/downloads/en/D ... 80379A.pdf17.3.1 REGISTERS
The MSSP module has four registers for SPI mode
operation. These are:
• SSPCON1 – Control Register
• SSPSTAT – STATUS register
• SSPBUF – Serial Receive/Transmit Buffer
• SSPSR – Shift Register (Not directly accessible)
SSPCON1 and SSPSTAT are the control and STATUS
registers in SPI mode operation. The SSPCON1 register
is readable and writable. The lower 6 bits of the
SSPSTAT are read-only. The upper two bits of the
SSPSTAT are read/write.
SSPSR is the shift register used for shifting data in and
out. SSPBUF provides indirect access to the SSPSR
register. SSPBUF is the buffer register to which data
bytes are written, and from which data bytes are read.
In receive operations, SSPSR and SSPBUF together
create a double-buffered receiver. When SSPSR
receives a complete byte, it is transferred to SSPBUF
and the SSPIF interrupt is set.
During transmission, the SSPBUF is not
double-buffered. A write to SSPBUF will write to both
SSPBUF and SSPSR.
8. Module: MSSP SPI
When the SPI clock is configured for Timer2 output/2
(SSPCON1<3:0> = 0011), the first SPI high time
may be short.
Work around
Option 1: Ensure TMR2 value rolls over to zero
immediately before writing to SSPBUF.
Option 2: Turn Timer2 off and clear TMR2 before
writing SSPBUF. Enable TMR2 after SSPBUF is
written.
9. Module: MSSP SPI
In SPI Master mode, when the CKE bit is cleared
and the SMP bit is set, the last bit of the incoming
data stream (bit 0) at the SDI pin will not be
sampled properly.
Work around
None.
10. Module: MSSP SPI
In SPI Master mode, when CKE bit is set, the
SSPBUF will reload the SSPSR output shift register
on every high-to-low transition of the SS pin.
Work around
Avoid using the SS pin when the CKE bit is set and
the MSSP is configured for SPI Master mode.
11. Module: MSSP SPI
When SPI is enabled in Master mode with
CKE = 1 and CKP = 0, a 1/FOSC wide pulse will
occur on the SCK pin.
Work around
Configure the SCK pin as an input until after the
MSSP is setup.
Dear Ryan, Doj and Steven,
Well Ryan, glad to hear that you are one step ahead of me in getting the 18F26K20. I have just ordered it one month ago and still waiting for the chip. Surprisingly the lead time is almost 3 months; to get the chip delivered.
I intend to use the chip for my project as well. And I am running SDFilesystem module in my current PIC 18F2525. It seems handy if I can port the code to the new chip without modifications / minor changes.
So I will be more than glad to hear from any of you who have head start of me to meet any luck in making it run on SF.
I am hoping the K series will run faster than my old 2525. Hope to hear more from you. And Doj, do you mind to post your reply again.
Thanks.
Regards,
Liak.
Well Ryan, glad to hear that you are one step ahead of me in getting the 18F26K20. I have just ordered it one month ago and still waiting for the chip. Surprisingly the lead time is almost 3 months; to get the chip delivered.
I intend to use the chip for my project as well. And I am running SDFilesystem module in my current PIC 18F2525. It seems handy if I can port the code to the new chip without modifications / minor changes.
So I will be more than glad to hear from any of you who have head start of me to meet any luck in making it run on SF.
I am hoping the K series will run faster than my old 2525. Hope to hear more from you. And Doj, do you mind to post your reply again.
Thanks.
Regards,
Liak.
Hello Liak,
I have been working with K20 pics since the first engineering samples last year and they have now only one real issue that I had a problem with.
It is an issue with the SPI module that stops the receive working if the module is not disabled between every single byte received.
Three month on from trying to find out why, I solved the issue a few days ago.
I tried to post the code and the forum tells me it is forbidden and will not allow me to post the code so I am unable to do that just now.
I have been working with K20 pics since the first engineering samples last year and they have now only one real issue that I had a problem with.
It is an issue with the SPI module that stops the receive working if the module is not disabled between every single byte received.
Three month on from trying to find out why, I solved the issue a few days ago.
I tried to post the code and the forum tells me it is forbidden and will not allow me to post the code so I am unable to do that just now.
Dear Doj,
Very glad to hear that you managed to solve the problem. So as for the solution for the faulty SPI module, how to overcome it? Can you somehow send me a copy of what you intended to post on the forum earlier? Can you PM me a copy? I have yet still to receive the chip to try it.
Help will be greatly appreciated.
Regards,
Liak
Very glad to hear that you managed to solve the problem. So as for the solution for the faulty SPI module, how to overcome it? Can you somehow send me a copy of what you intended to post on the forum earlier? Can you PM me a copy? I have yet still to receive the chip to try it.
Help will be greatly appreciated.
Regards,
Liak
Dear Mark and Ryan,
Since I am still waiting to get the K series on my hand, I would like to ask some advise from you guys. BTW thanks again Mark for the reply. I have received the email.
Have you people run into any problem programming the K series using SF? Just an advanced notice of any problem that I may encounter using it.
Thanks.
Regards,
Liak
Since I am still waiting to get the K series on my hand, I would like to ask some advise from you guys. BTW thanks again Mark for the reply. I have received the email.
Have you people run into any problem programming the K series using SF? Just an advanced notice of any problem that I may encounter using it.
Thanks.
Regards,
Liak
Liak, the only K series that I have used extensively is the 44K20. It is programmed with a PICKit2 and I have not had any issues. It uses a 16MHz resonator with PLL giving a 64Mhz clock. For this application, entirely coded in Swordfish (my favorite compiler and the ONLY reason why I still use some 8-bit PICs - just wishing for PIC24/dsPIC33 support), the 44K20 controls a 128x64 GLCD, 24 capacitive touch keys/buttons, 6 LEDs and piezo buzzer. All 4 timers are used and mostly interrupt driven (using both HIGH and LOW priority).
Dear rmteo,
Thanks for sharing. Nice to hear some K series brother running well outside on SF.
Yeah one point I definite agree with you! I am so deeply in love with SF! Definitely efficient and exact compiler.
After reading through some features of PIC24, the desire to move over the platform is swelling! 16bits bus and ALU, and single execution in 2 clock cycles... The desire to use it is akin to owning a sport car! If only SF runs on it.
Is David working on anything in this direction?
I will definitely be joining rmteo in his rush to own it.
Regards,
Liak
Thanks for sharing. Nice to hear some K series brother running well outside on SF.
Yeah one point I definite agree with you! I am so deeply in love with SF! Definitely efficient and exact compiler.
After reading through some features of PIC24, the desire to move over the platform is swelling! 16bits bus and ALU, and single execution in 2 clock cycles... The desire to use it is akin to owning a sport car! If only SF runs on it.
Is David working on anything in this direction?
I will definitely be joining rmteo in his rush to own it.
Regards,
Liak
The only official statement is here:
http://www.sfcompiler.co.uk/wiki/pmwiki ... evelopment
http://www.sfcompiler.co.uk/wiki/pmwiki ... evelopment
Right now I use a competitor's compiler for the PIC24H/J and dsPIC33s. They are really nice (much easier to use compared to the PIC18s) and they are my first choice when selecting a microCHIP MCU.Will Swordfish Support the dsPIC or PIC24 Microcontroller?
We are actively looking at this, but no timescales at the moment I'm afraid. The architecture is very different from the 18 series, so it's a big piece of work - but it is work in progress.
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
18f25k20 and 18f45k20
Ohararp:
I have used the 25k20 and the 45k20 with the SD library (thanks to Steven).Both worked very well for playing Wav Files.
If you still have problems, I can send to you the configuration I did use.
Greetings...
Ruben de la Pena V.
I have used the 25k20 and the 45k20 with the SD library (thanks to Steven).Both worked very well for playing Wav Files.
If you still have problems, I can send to you the configuration I did use.
Greetings...
Ruben de la Pena V.