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.

Recent content by heydonms

  1. H

    compiled code not working properly

    You are still setting each of the bits individually. I don't know how to do it in their flavour of BASIC, but you need to write to the entire GP register in one go rather than manipulating individual bits. Something like: Dim MyGP as byte MyGP.0 = 1 MyGP.1 = 1 MyGP.2 = 1 MyGP.3 = 1 GP = MyGP...
  2. H

    compiled code not working properly

    I've never used the 12F series and I don't even recognise the language you are using (% as a prefix of a binary constant? some Pascal variation or something?) so I'm not going to try to give a working example but the general idea is that the BSF and BCF operations (as well as a few others) read...
  3. H

    compiled code not working properly

    Setting the pins to digital might work under most circumstances, but I believe that best practice is to avoid using read-modify-write operations on ports. In the higher end uC's you have the latch registers specifically for this purpose, if you can spare the RAM and tolerate the minor...
  4. H

    Interrupts problem

    Without knowing exactly what processor you are using it is hard to say, but as a general rule each DMA device should have its own interrupt flag (you say "several DMA channels...in parallel" you don't mean they are sharing interrupts do you?). You should be able to check the flags at the start...
  5. H

    Is it possible???

    I'm glad it works, but if I can offer some more advice regarding general programming practices, don't fall into the "not invented here" trap. Just because someone else wrote something doesn't make it bad, just because you wrote something doesn't make it good (and vice versa). You said that...
  6. H

    [MPLAB] Multiplication (*) doesn't work

    An easy fix for this is to declare the variable volatile. On a PC you could just output it to the screen, but in a uC it can a bit harder to use a variable in a way that doesn't effect the operation of the code, but also can't be optimized out by the compiler. By marking it as volatile the...
  7. H

    Is it possible???

    For the most part, it shouldn't be. If your code and your design are significantly different from each other, one or both of them need work. The pseudo code northguy posted is 95% of the way to being valid C, it shouldn't take massive changes to get it to compile.
  8. H

    Is it possible???

    This whole thing is rather convoluted, messy and difficult to follow. Using goto to jump in an out of infinite loops, assigning PORTB to itself, it looks like you started coding without a clear idea of what you were trying to do. I would suggest three things: Write out your algorithm before...
  9. H

    How to trick "auto-on" headlamps?

    I'm going to go out on a limb and say that maybe Nevada has slightly different weather patterns to the UK. I can count on the fingers of one hand the number of times I've seen actual fog within 300KM of my house. Weather aside, automatic headlights aren't an excuse for being oblivious, they can...
  10. H

    Image encoding...

    An SBC like the RPi or BBB doesn't seem like a great fit, if it needs to be stand alone then a mid range micro is easily up to the task. It will be faster (no boot time), smaller, use less power and be less complex. If it doesn't have to be standalone, then just use an ADC connected to USB and...
  11. H

    Image encoding...

    Read up on the TIFF format. It's relatively simple and well within the capabilities of a uC. https://www.fileformat.info/format/tiff/corion.htm
  12. H

    what is real time operating system ?

    Fair enough, I wasn't aware that functionality was available, but that doesn't change the fact that GC doesn't mean re-arranging, it means automatically freeing unused memory. Compacting means rearranging the used memory. Apparently some GC's will have compacting functionality, but that isn't...
  13. H

    what is real time operating system ?

    I'm not quite sure what you are saying here, but this: is way off. GC is quite well defined, it refers to a process of freeing memory that is no longer in use. It doesn't move other memory allocations around.
  14. H

    Apple Mac power supply

    Yep. They say you need heatsinking if you go over 2A, but I would keep an eye on the temps once you start pulling about 1A just to be on the safe side.
  15. H

    Keypad matrix hardware debouncing, help needed

    Check that your problems are actually problems before solving them, unless you're running your uC right at the limit of what it is capable of there is no reason that you should miss key presses when polling, and if you are then you should fix your code or get a faster micro.
Back
Top