Remove Text Formatting
Loading...

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    116

    Default Figured Out MPLAB X

    Well, at least enough to get some LEDs blinking with Assembly Code. Following an older (2007 I think) book, I was able to get some basic things happening with MPLAB 8.90 several months ago. Try as I may, I couldn't get ANYTHING happening with MPLAB X. Over the holidays I decided to watch videos, read Application Notes, and play until I could get functional. Played with a PIC12F1822 and PIC18F13K22. Tried to do something with the PIC18F26K42, but kept getting errors. There are template (TEMPO.ASM) examples for select MCUs, mostly older ones. Apparently there is something different about the K42 where the K22 TEMPO doesn't work. I did notice the overall format was different between the 12F and 18F. Next I want to learn the nuts & bolts of C code, again, at least enough to be skeletally functional.

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    1,232

    Default Re: Figured Out MPLAB X

    Next I want to learn the nuts & bolts of C code, again, at least enough to be skeletally functional.
    every time I compile with xc8 I get this charming statement

    You have compiled in FREE mode.
    Using Omniscient Code Generation that is available in PRO mode,
    you could have produced up to 60% smaller and 400% faster code.
    See http://www.microchip.com/MPLABXCcompilers for more information.
    its almost as if they want you to feel bad and use arduino's instead ,I won't pay $1000 for whats now just a hobby.
    This is more entertaining than Free to Air TV

  3. #3
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    116

    Default Re: Figured Out MPLAB X

    Agreed. I probably won't spend a $grand for high performance XC8. My reason for wanting to learn the basics of C are several-fold. First, there is a massive wealth of information available to do various things... in C. If I can understand it better, I can port it to PBP. Second, I would like to at least dabble with some of the higher level 16-, 24-, and 32-bit PIC MCUs. Who knows, I may fall in love. Next, my wife & I are Mac users. I started learning Visual Basic (part of the Visual Studio 2015 bundle) to create apps for the PC. As Mac users, my wife is starting to learn X Code for creating Mac apps. It is a variation of C called Objective C. Furthermore, this isn't just a hobby for me, I create electronic gizmos for a living. Having never gone to school for any of it (analog or digital electronics), I have a massive library that I refer to often. I subscribe to about 1/2 dozen electronics magazines, plus receive daily/weekly emails with electronics news & new products. I learned by doing, trial & error. I learned how to learn from books. Working on my New Year's Resolutions, I simply decided it's time for me to learn more of the nuts & bolts of the tools I use every day, acquire some new skills, and refine some comfortable ones.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    1,232

    Default Re: Figured Out MPLAB X

    in C. If I can understand it better, I can port it to PBP
    i have been doing the same thing but pbp is going nowhere .i think its time to go the other way i.e
    converting to C from pbp ,If I can understand it pbp then its easy in C. i have been hanging on so as
    to be able to support my older products but really!.
    conversion is not too onerous and once i get it going in C i can refine away using the obvious advantages
    available . its taken a while to come to terms with the microchip code configurator but if you are
    working with chips with pps then its well worth the effort.

    after ioannis got me interested in apa10c rgb leds i discovered i had 17 more of them and thought why not
    make a animated "star" to christen the top of the christmass tree.

    the idea seemed pretty straight forward a good simple project, but it soon got tedious trying to manipulate
    24bit vars in pbp. data transmission was slow and getting it to function in an isr was problematic
    so i gave up and went asm, which generated another set of issues when the code needs to port between
    pic16/18 devices.
    in C with its abundant variable types combined with structures and unions its just so simple no mental
    gymnastics required and once functional in C its just a simple task using the code configurator [MCC] to
    port it to other chips.
    interestingly a led dataframe [ 24bit start, 17 x 32bit data ,24bit stop ] sent in isr
    time asm pic18f26k22@64m 410uS, C pic18f26k22@64m 608uS, C pic16f18326@32m 667uS.
    turns out C is not too bad at banging out bytes from complex arrays ,even if its not optimised .isr's are way easier to implement.
    this really meant that asm was no longer even a consideration for this application.

    here's the pbp version and the first draft of the C conversion done with a 18f26k22 , although the finished
    project went on a 16f18326.
    Attached Images Attached Images  
    Attached Files Attached Files
    This is more entertaining than Free to Air TV

Similar Threads

  1. Mplab x
    By l_gaminde in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th July 2013, 04:59
  2. Mplab 8.40
    By Andre_Pretorius in forum General
    Replies: 1
    Last Post: - 25th November 2009, 20:42
  3. Errors In MPLAB 8.02
    By HOTLNC in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 4th June 2008, 13:52
  4. using MPLAB 8.0 ?
    By iugmoh in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st May 2008, 21:07
  5. Mplab 7.22
    By Patrick in forum Documentation
    Replies: 3
    Last Post: - 1st June 2006, 06:32

Members who have read this thread : 17

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts