Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Split The Job

Status
Not open for further replies.
Remember im using a Smaller uC not as much memory than certain PIC24 or PIC32. Not the same to copy it and mod it. Its way harder than you are explaining. If i have a PIC with the same specs as a ARM or something similar im sure i can port the code over without hassle. But i cant simply alter little lines of code when the whole thing is different.

Interrupts for example. I have to remove that whole thing and recreate the RTC with my own interrupt. Its not hard but its not like thats the only line to change. I understand how easy it would be with a good PIC on hand but this is the best one i have as of now so im stuck :D
 
What? The RTC code is to get info from an actual RTC, just strip it and place a hardcoded value in the time variables. There's a reason that's in the main.c file, because it's not part of the library. Like I said, all that code in main.c can be stripped and simplified to a few lines. I'm using an 8 bit micro, not an ARM7 or anything fancy. I think you're looking at it and thinking it's more complex than it really is.

The only thing you need to change in the PIC sample code is to use either FatFS or Tiny FatFS is in the MMC.C function.

  • You need to change the SELECT and DESELECT macros to toggle the slave select line.
  • You need to update disk_initialize to initialize your SPI hardware block, if it's not already there for your PIC.
  • You need to update xmit_spi, and rcvr_spi for your hardware specific SPI write and receive data.
  • Get rid of the power functions and the xchng_spi function.
  • Replace anything that relies on timers with simple while loops.
Otherwise the main.c can be stripped totally and replaced with just the setup variable and a call to initialize, mount, read or write the disk, then close it. Main.c in the samples is just an overly complex sample application which isn't needed.
 
What? The RTC code is to get info from an actual RTC, just strip it and place a hardcoded value in the time variables. There's a reason that's in the main.c file, because it's not part of the library. Like I said, all that code in main.c can be stripped and simplified to a few lines. I'm using an 8 bit micro, not an ARM7 or anything fancy. I think you're looking at it and thinking it's more complex than it really is.

The only thing you need to change in the PIC sample code is to use either FatFS or Tiny FatFS is in the MMC.C function.

  • You need to change the SELECT and DESELECT macros to toggle the slave select line.
  • You need to update disk_initialize to initialize your SPI hardware block, if it's not already there for your PIC.
  • You need to update xmit_spi, and rcvr_spi for your hardware specific SPI write and receive data.
  • Get rid of the power functions and the xchng_spi function.
  • Replace anything that relies on timers with simple while loops.
Otherwise the main.c can be stripped totally and replaced with just the setup variable and a call to initialize, mount, read or write the disk, then close it. Main.c in the samples is just an overly complex sample application which isn't needed.

lol I like bothering or complaining dont i lol you couldnt just say this before? :D
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top