Author |
Message |
Topic: from circular buffer to signed int16 |
dorinm
Replies: 14
Views: 16118
|
Forum: General CCS C Discussion Posted: Wed Jan 22, 2014 5:08 pm Subject: from circular buffer to signed int16 |
Usually you use a circular buffer when you don't have enough time to process all the incoming data and need a buffer (that's what really is, nothing more).
If you want to update a var every time yo ... |
Topic: Read voltage using 16f877 with 12bit External Adc (ltc1297) |
dorinm
Replies: 4
Views: 10004
|
Forum: General CCS C Discussion Posted: Tue Jan 14, 2014 3:49 am Subject: Read voltage using 16f877 with 12bit External Adc (ltc1297) |
#ifndef ADC_CS
#define ADC_CLK PIN_B0
#define ADC_DOUT PIN_B1
#define ADC_DIN PIN_B2
#define ADC_CS PIN_B3
#endif
void adc_init() {
output_high(ADC_CS);
& ... |
Topic: mpu6050 problem |
dorinm
Replies: 3
Views: 8070
|
Forum: General CCS C Discussion Posted: Mon Jan 06, 2014 6:46 am Subject: mpu6050 problem |
your reading is correct, as mpu6050 defaults to "i2c master mode" (internally) in which you'll read only it's address, the acc and magneto will be internally slaves; please read the datashee ... |
Topic: hex to decimal converter - efficiency |
dorinm
Replies: 9
Views: 26957
|
Forum: General CCS C Discussion Posted: Thu Dec 12, 2013 3:18 pm Subject: hex to decimal converter - efficiency |
more interesting, too!
.................... //actually, we start here
.................... h=l;
002FE: MOVFF 2C,2A
00302: MOVFF 2B,29
....................
....... ... |
Topic: hex to decimal converter - efficiency |
dorinm
Replies: 9
Views: 26957
|
Forum: General CCS C Discussion Posted: Thu Dec 12, 2013 10:53 am Subject: hex to decimal converter - efficiency |
interesting enough, i found an idea (intended for verilog) for binary to BCD
http://www.eng.utah.edu/~nmcdonal/Tutorials/BCDTutorial/BCDConversion.html , there might be done for the BCD to binary, f ... |
Topic: IMU 3000 I2C Question |
dorinm
Replies: 51
Views: 66120
|
Forum: General CCS C Discussion Posted: Fri Nov 29, 2013 5:18 pm Subject: IMU 3000 I2C Question |
..aaand , the other solution:
to read directly the ADXL , THRU' the IMU3000
#define IMU3000_WR 0xD0
#define IMU3000_RD 0xD1
#define IMU3000_REG_X 0x1D //GYRO_XOUT_H address
#define AD ... |
Topic: IMU 3000 I2C Question |
dorinm
Replies: 51
Views: 66120
|
Forum: General CCS C Discussion Posted: Fri Nov 29, 2013 4:33 pm Subject: IMU 3000 I2C Question |
ths is a quick'n'dirty port from here
#define IMU3000_WR 0xD0
#define IMU3000_RD 0xD1
#define IMU3000_REG_X 0x1D //GYRO_XOUT_H address
#define ADXL_POWER_CTL 0x2D
#define IMU_ADXL_WR 0x53 // ... |
Topic: Radical olympic++ ADC averaging , de-noising routine |
dorinm
Replies: 30
Views: 185617
|
Forum: Code Library Posted: Thu Oct 24, 2013 7:11 pm Subject: Radical olympic++ ADC averaging , de-noising routine |
Yes it is a good idea indeed ... I've also used a similar method for slow changing variations where "almost" realtime was not necessary;
....just for completeness sake, I would add that i ... |
Topic: HMC5883L Convert to heading |
dorinm
Replies: 5
Views: 23185
|
Forum: General CCS C Discussion Posted: Sat Aug 03, 2013 5:41 pm Subject: HMC5883L Convert to heading |
excellent! |
Topic: how add hysteresis in my code |
dorinm
Replies: 17
Views: 34442
|
Forum: General CCS C Discussion Posted: Thu May 09, 2013 2:57 pm Subject: how add hysteresis in my code |
so, if you want some help (and thank's Mike, I do know what it means to live betveen 6kV lines ), first do what Mike suggested and isolate the PIC from your mains, anything else could lead to unde ... |
Topic: how add hysteresis in my code |
dorinm
Replies: 17
Views: 34442
|
Forum: General CCS C Discussion Posted: Wed May 01, 2013 3:02 pm Subject: how add hysteresis in my code |
I need a circuit to protect my house electrical equipment
from main power up and down.
I have a prototype board for check my circuit.
I use 230v ac > dc and a resistance divider network to down ... |
Topic: how add hysteresis in my code |
dorinm
Replies: 17
Views: 34442
|
Forum: General CCS C Discussion Posted: Tue Apr 30, 2013 3:19 am Subject: how add hysteresis in my code |
if(adc_u<230 && adc_u>190)
output_high(pin_a5);
else if(adc_u>240 || adc_u<170)
output_low(pin_a5);
I assume that normal voltage should be ... |
Topic: 6DOF imu (ADXL345 and itg3200) |
dorinm
Replies: 13
Views: 39673
|
Forum: General CCS C Discussion Posted: Sat Apr 13, 2013 3:37 pm Subject: 6DOF imu (ADXL345 and itg3200) |
I have ported the AVR AHRS code for sparkfun 9dof imu (https://www.sparkfun.com/products/10724) to 18f26K22 (clocked@64MHZ because I needed 50Hz output and calculations take ~3msec. plus other functio ... |
Topic: PIC18F46J11 I2C and RS232 problem |
dorinm
Replies: 3
Views: 6084
|
Forum: General CCS C Discussion Posted: Fri Feb 01, 2013 12:13 pm Subject: PIC18F46J11 I2C and RS232 problem |
try to use fast_io, the set your tris manually; you might use as well ERRORS in your rs232 setup (#use ....);
...and, we don't know anything about your i2c device but it seems that you don't read a ... |
Topic: Button command response slow |
dorinm
Replies: 5
Views: 8136
|
Forum: General CCS C Discussion Posted: Sun Jan 06, 2013 9:32 am Subject: Button command response slow |
what do you mean "very slow"? 10/s? 1/s? how many increments? I assume (from your code) that 1 digit number takes ~20ms to "print", 2 digit ~40ms ... su 6digit will take ~120msec ( ... |
|