1. 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.
    Dismiss Notice

PIC18F25K42 a work in progress....

Discussion in 'Microcontrollers' started by granddad, Sep 29, 2017.

  1. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,997
    Likes:
    512
    Location:
    Cleveland, OH, USA
    Which Rigol do you have? If it is the DS1054 line, PM me.

    John
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,301
    Likes:
    648
    Location:
    Derbyshire, UK
    No idea, my Rigol is the cheaper DS1052E - no logic facilities.

    I do have a very cheap USB logic analyser though, which I'm going to have to dig out and figure out how to use, as I'm still having TFT 'problems'. It's rather strange, I have a couple of ST7735 based TFT's, one is 128x128 (and is shown working from a 24F in the video I posted), the other is 128x160. The setup's for the two displays are slightly different, but if I setup an Arduino Mini Pro for either, I can plug either display in and I get 'some sort' of display, it might be the wrong size or off centred, but it works. With the PIC version only the 128x128 display works, even if I do the 128x160 setup (but obviously wrong size wrong colours etc.) - all I ever get on the 128x160 display on the PIC is a blank white screen.

    So I'm a bit bemused, I've even gone to a lot of trouble to try and make the graphics and setup routines as identical as possible - I'm hoping that comparing PIC to Arduino with the analyser might show me the problem?.
     
  3. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    759
    Likes:
    76
    Location:
    Worcestershire UK
    I have decided not to use the 2x16 blue display, and use a I2C Back_pack slave ( My home brew PIC16F1827 ) , can take most character LCD's, so having to modify old master code from PIC24 progs. So my next post on K42 may be a while ...

    I noticed Microchip told me how bad my code was :eek: and suggest I send them some of my pension , to make it run better...
    Shame they don't do a "hobbiest" or "Mature student" MPLABX, XC8 version .... :joyful:

    omnscient.jpg
    I had to check a dictionary for Omniscient ....
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,301
    Likes:
    648
    Location:
    Derbyshire, UK

    Actually they told you how bad THEIR code was :D

    If you actually google about it, in free mode their compilers deliberately add load's of totally spurious code in order to make the code run slowly, and take up much more space than actually required. A simple loop checking an I/O pin runs so slowly as to make it impossible to read IR remote signals as my assembler tutorials do. But even at that, my XC16 TFT graphics demo on a 24F runs considerably faster than the Arduino version (which is a much lower spec processor).

    The MPLABX IDE also runs very slowly, it takes forever to compile XC16 programs, although XC8 ones are a little faster.

    I was having speed problems with the Arduino IDE, which I cured by adding various directories to be skipped by my anti-virus, and that helped massively - it compiles quite quickly now.
     
  6. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    759
    Likes:
    76
    Location:
    Worcestershire UK
    Hi Nigel, I don't recall any compile speed problems with XC16 , but my stuff was not that big ... ,What PIC24 are you using... as I said X seems to run better on linux.mint , screens not a good as windows , perhaps i need a different GUI scheme. any way to take out the MC filler ?
     
  7. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,301
    Likes:
    648
    Location:
    Derbyshire, UK
    I'm using a 24FJ64GA002 - chosen because it was pretty cheap, and doesn't require an external crystal.
     
  8. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,641
    Likes:
    109
    Location:
    Michigan, USA
    Grandad, do you know where the configuration word descriptions are? I usually find them in the PIC18F26K42.INC file but they're not there.
     
    Last edited: Nov 2, 2017
  9. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    759
    Likes:
    76
    Location:
    Worcestershire UK
    Hi Mike , You thinking name problems, I usually use the MPLABX memory view , configuration bits , and check / use the drop down boxes , at first run send to output to copy and paste, any help ?
     
  10. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,641
    Likes:
    109
    Location:
    Michigan, USA
    Ah! Thank you!
     

Share This Page