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

This simple PIC24 assembly code doesn't execute. I don't know why.

Discussion in 'Microcontrollers' started by Rich D., Nov 1, 2017.

  1. atferrari

    atferrari Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    2,848
    Likes:
    122
    Location:
    Buenos Aires - Argentina
    ONLINE
    :wideyed: Wow :wideyed: :p
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,517
    Likes:
    937
    Location:
    Rochdale UK
    ONLINE
    Para C oprima ocho por favour!!
    I translated it, but I didn't get it!! Am I slow??
     
  3. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,283
    Likes:
    552
    Location:
    Cleveland, OH, USA
    That is a common phrase in the US whenever one calls a national institution, like a bank. Other's may use a different number, my bank uses 8 and I like the sound of ocho.

    Coming after Rich's comment in post #12, I thought it silly, but fitting.
     
  4. dave

    Dave New Member

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


     
  5. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    778
    Likes:
    76
    Location:
    Worcestershire UK

    Rich, Been watching this thread... :banghead: ( I wanted a scratch head here) You got some very efficient code to flash a led... where you going now ... Its like buying a Ferrari , and not putting any fuel in it....
     
  6. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    275
    Likes:
    22
    Location:
    West Chester, PA
    I am developing a touchscreen controller to control a vacuum chamber that can either run 50...100 amps thru a carbon rod that vaporizes and deposits on a sample, or a low-current 1000 volt power supply that "boils" off gold to deposit on a sample.
    These samples are to be prepared for electron microscopes, which need to have a conductive surface. If not conductive, the charge from the bombarding electrons build up and you end up with a white-out image.

    The hi-res color touchscreen requires a some intense processing to avoid the user's perception of slowness. Beyond that, I like to keep the software task simple and quicker by spending an extra buck to get the performance out of the software. Simple & quick software can reduce the number of bugs in the software. So the LED flashing is merely a simple "Hello World!" message to prove the compiler/programmer/microprocessor chain. The LED flashing is not the end product!
     
  7. Beau Schwabe

    Beau Schwabe Member

    Joined:
    Jun 4, 2017
    Messages:
    57
    Likes:
    6
    If you mind me asking what touch screen do you plan on using for your project?

    We use a 7 inch touch screen from 4D Systems, and the way we have it setup works well, but there was a lot of development and learning curve to get where we are now. Basically the touch screen acts like a dumb terminal with constant bi-directional communication between the micro and the display. Every event that happens on the display is communicated to the micro and vise versa. The micro runs a "fall through state machine" allowing several state machines to run atomic processes. Imagine a flow chart where each block is assigned an index number ... instead of waiting and getting stuck in a loop each block conditionally sets the index. The micro dispatches to the current index. Multiple indexes allow for atomic functionality. All communication is done as a high priority interrupt, where the low priority interrupt is used for a basic heartbeat mainly as a mechanism to keep timing deterministic. As I said our system works well, but I would be curious how others setup their framework.
     
  8. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    275
    Likes:
    22
    Location:
    West Chester, PA
    Sounds like you have a hi-rel, safety critical system there - I am guessing because it sounds a bit complicated.

    I am using a Reach brand screen.
    https://www.reachtech.com/support/product-specific-documentation/51-0105-02/
    They make OEM screens here in the USA. It has a powerful microprocessor on it that handles all the touch, and draws on the screen. It communicates with my controller at 115,200kbps on a UART.
    So all touches, and all display commands are via the UART. The controller can draw lines, shapes, different fonts, etc. and can put up bitmaps that are pre-loaded. It offloads a lot of my processor work to the display.
    I'm experimenting with a 4.3" display, but this same UART interface can be scaled up to much bigger touchscreens, I think something like 8 or 10 inches.
     
  9. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    778
    Likes:
    76
    Location:
    Worcestershire UK
    I see the reasoning for easing yourself in to PIC24 with a led , Why not write the startup in C , config PLL IO setting etc and put your time critical routines in asm , mind you if you run the PIC at maximum MIPS , wont be much difference....
     
  10. Rich D.

    Rich D. Member

    Joined:
    Feb 3, 2014
    Messages:
    275
    Likes:
    22
    Location:
    West Chester, PA
    Scroll back and see my comment #18.

    C sucks.
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,517
    Likes:
    937
    Location:
    Rochdale UK
    ONLINE
    Once... Sometime ago, I asked a very similar question.. Why use C.. ASM is far superior..

    The answer came.... ASM is far superior if you are really good at it. But if you are novice ~ beginner ~ newby... Then you will write more efficient code in C... The reason!! Well C was written by professional ASM programmers..

    Even a professional ASM programmer cannot write code at the speed a beginner C programmer can... Debugging C is far quicker than debugging ASM.. So for the several bytes or several nano seconds saved, hundreds of pounds / dollars are saved..
    I have always liked coding in C... Of the two, I only use ASM in very rare situations...
     

Share This Page