Hello,
A colleague of mine has designed a system that hosts a ADC device connected to a SPI bus, but only via the MISO (the MOSI pin of that particular bus is used for another purpose and cannot have its role changed to MOSI on the fly just to address the device). To the best of my knowledge, it is not possible to address any SPI device using a MISO only (it is possible, of course, by using only the MOSI) as no clock pulses are generated by reading from the SPI FIFO. Any thoughts...?
Did he leave the other signal on the ADC unconnected, or to another pin of the processor?
It is not connected...I see a hardware redesigned in the horizon!
Hi,
I need to make an AC/Universal motor controller with RPM count. In the first phase I started coding for tacho part. But my tacho is very instable. I attached the coding and proteus file. Please help.
// C Compiler // ------------------------
#include <project.H>
#fuses HS //High speed Osc (> 4mhz) #fuses NOBROWNOUT //No brownout reset #fuses NOPROTECT //Code not protected from reading #fuses NOWDT //No Witchety Dog Timer //#FUSES NOPUT //No Power Up Timer
#define use_delay(clock=20M) //20Mhz crystal
#pragma priority SFR1, TIMER1, UB // Set interrupt priority
#include <flex_LCD.c>
// Tach reading int16 isr_ccp_delta; void ccp1_isr(void) interrupt using 3 { int16 current_ccp; static int16 old_ccp = 0;
// Read the 16-bit hardware TIM1 register current_ccp = TIM_1; isr_ccp_delta = current_ccp - old_ccp;
// Save the current ccp value for the next pass old_ccp = current_ccp; }
//Main function starts here void main(void) { int16 current_ccp_delta; int16 rev;
lcd_init(); //LCD start lcd_putc("\f"); // Clear the LCD delay_ms(100);
set_timer1(0); setup_timer_1(T1_INTERNAL | T1_DIV_BY_1); // T1_DIV_BY_8 to reduce the lower limit on the RPM range
clear_interrupt(INT_TIM11); enable_interrupts(INT_TIM11); enable_interrupts(GLOBAL);
while(1) { disable_interrupts(GLOBAL); current_ccp_delta = isr_ccp_delta; enable_interrupts(GLOBAL);
rev = (int16)(5000000L / current_ccp_delta); //period in seconds rev *= 60; // period in minutes
lcd_gotoxy(1,1); //Goto first line printf(lcd_putc, "%lu RPM ", rev); // Display RPM
delay_ms(100);
}