Exactly, the calculated time delay is the time it takes for the LED's to move to one columb to the next.
I was referring to the number crunching part of the program, it's 100% functional. I...
Type: Posts; User: dannybeckett
Exactly, the calculated time delay is the time it takes for the LED's to move to one columb to the next.
I was referring to the number crunching part of the program, it's 100% functional. I...
Those ideas are really good anduril... I will experiment and let you know how it goes.
Ahh I see, I am not using any intrinsic functions like that. The only things not native to the language are the very self explanatory names for accessing certain register bits, output ports, etc such...
Basically the program is to control a spinning persistance of vision LED display, very simalar to this: YouTube - Spinning LED Display using Fan Motor 2 - Featured on Hacked Gadgets
The include...
I have a vague idea, using DECFSZ to decrement the variable passed to it from the C program. Does anyone know how to protect 16 bits of memory from being overwritten by anything else and place a...
A PIC16F887, and the while loop is there just to keep the processor idling when it's not doing anything
Hi guys. I have prtty much completed an embedded design project I am working on, a spinning LED persistance of vision display. Every aspect of the program works fine apart from the delay routine.
...
And since 3000/31250 is all fractional, the output is 0. I was getting confused thinking that any integer maths when assigned to a float would come out as 0. Thanks for the help everyone.
you sir have just given me the solution to a much bigger problem. Thanks alot!!!!
You both*
float revolutionTime_S = 3000/31250;
"This will always evaluate to 0, since the division is...
Heres my code:
#include <htc.h>
#include <stdint.h>
#define _XTAL_FREQ 8000000
__CONFIG (FOSC_XT & WDTE_OFF & PWRTE_ON & MCLRE_ON & CP_OFF & CPD_OFF & BOREN_OFF & IESO_OFF & FCMEN_OFF &...
I see, thanks for clearing all this crap up for me =D
yeah I can use stdint.h, thats awesome. Whats the _t for at the end?
A little more to add... I took the above program and shifted the bits incrementally from 8 to 16. As you would expect, the single LED traveled from RB7 to RB0 - then when I shifted it 16 times...
Yeah weird isnt it. I'm thinking that the bits it's bringing into int test as it shifts them alongto the right are all 1's?
Putting in things like that light up exactly how you would expect them...
0xFFFF shifted left 10 times should now read 0x3F the same as 0xFF00 would, or is that wrong? I'm assuming PORTB = temp in your example, unfortunately that didn't work either! all 8 LEDs lit up on...
I have 1 more question for you guys. I want to test wether the operations I am performing on this combined value are actually working, and the way I can do that is split the new value back up again...
hahahaha yeah I'll include all the facts next time I think :p At least I learned quite a lot! Yeah the whole hex system makes sense to me now, I think im more glad that's been de-mystified than the &...
Thanks for that excellent explanation Anduril! I now know exactly why I wasn't understanding what issue this anding was addressing,
You are absolutely correct, I am doing embedded stuff. I am...
Thanks for the explanations guys. I understand the bitwise operation of & and << now, I also understand the operation of both statements (is that meant to be an & between the two terms Anduril?)
...
Excellent, thanks a lot. I know that value wont fit into a 16 bit binary number, I was being rediculous choosing it in the first place. I believe 123456789 corresponds to 111010110111100110100010101...
Yep I thought I was. I've been at this for ages so everything is a littlr blurry, I knew half the stuff you just pointed out =/ I've rethought the whole thing - would this work:
t1 = (TMR1H*256)...
#include <stdio.h>
#include <string.h>
main() {
int TMR1H = 12345678;
int TMR1L = 12345678;
char str1[8];
char str0[8];
str1[0] = TMR1H;
str0[0] =...