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.
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...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...
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.
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.