Jump to content

hr369

Member
  • Joined

  • Last visited

Everything posted by hr369

  1. Update time. I've received the purple pcb oscillator and installed it. It's way smaller that it looks in the pictures. It took about 20 minutes to solder in the new board and bolt it in. I will be testing it with my other clocks to see how accurate it is. Right now i've had it running a couple hours and its keeping accurate time. It has built into it, reverse polarity protection for those of us that are electronically challenged, myself included. I've ordered a small amount of boards as I don't anticipate many people will need them. clock running with new purple oscillator Reverse engineering this clock and running it on 21'st century electronics was no small feat. Here is some of the C code that Eric wrote for the prototype and resides in the little IC chip. AWESOME work he does. __________________________________________________________________________________________________________________________________________________ #include <htc.h> #include <xc.h> //#include <float.h> // do I need this? #define _XTAL_FREQ 4000000 // Internal Oscillator... for now. Required // for __delay_ms function /* The configuration bits can be set in the IDE 'Configuration Bits' window, * or they can be set here. */ // PIC12F675 Configuration Bit Settings: /* CONFIG */ #pragma config FOSC = INTRCIO // Internal oscillator. #pragma config WDTE = OFF // Watchdog Timer disabled. #pragma config PWRTE = OFF // Power Up timer off. #pragma config MCLRE = OFF // MCLR pin disabled, I/O function of GP3. #pragma config BOREN = OFF // Brown-out detect off. #pragma config CP = OFF // Program memory code protection off. #pragma config CPD = OFF // Data memory code protection off. unsigned int pulse_width_count = 0; // Used to adjust pulse width. volatile unsigned int T_pot_setting; // Most sig 8-bits from pot ADC conversions. volatile unsigned int F_pot_setting; // Use all ten bits, so need 16-bit word. volatile char outputs; // bit0 for output 0 (GP0), bit1 for output 1 (GP1). volatile unsigned int analog_reading; // The 10-bit ADC result. /********************************* SETTING UP ************************************/ /*********************************************************************************/ void init_ports(void){ // Set input & output pins: GP2 (AN2) and GP4 (AN3) set as inputs for analog signal, // GP3 can only be input. TRISIO = 0b00011100; // Comparators off. CMCONbits.CM = 0b111; // Analog input register ANSEL set in setup_ADC() below. } //////////////////// void setup_osc(void){ ; // Nothing to do here. The oscillator is set above by setting the FOSC bits. // OSCCAL = 0x00; // Shouldn't be needed. } //////////////////////// void setup_timer1(void){ // Timer1 is 16-bit. It will count to 65535 before overflowing. // With a 4MHz internal clock (Fosc), the instruction clock operates at 1MHz: // (Fosc/4, so Tcyc = 1usec). // With a desired interrupt time of 11.43msec, we have 11430 instruction cycles, // which is under the 65535 cycles possible with Timer1. So using Timer1 should be // fine! T1CONbits.TMR1ON = 1; // bit 0 = 1: TMR1ON -> turn timer on. // bit 1 = 0: TMR1CS -> Clock source = Fosc/4. // bit 5,6 = 00: T1CKPS -> prescaler = 1:1 - no scaling. } ///////////////////// void setup_ADC(void){ // Pulse_Width is analog input on AN2. // Pulse_Frequency is analog input on AN3. // Set ADCON0 configuration bits: // ADFM = 1 : ADC result right justified as we will use all ten bits. Two most // sig bits in ADRESH, the eight least sig bits in ADRESL. // VCFG = 0 : ADC reference is Vdd pin.. for now. // <CHS1:CHS0> = 0b10 (2dec) to select AN2 input, (<CHS1:CHS0> = 0b11 3dec) for // AN3 input. // ADON = 1 : Turn on the ADC. ADCON0bits.ADFM = 1; // ADC result right-justified. ADCON0bits.CHS = 3; // Select AN3 for ADC for first conversion (freq). ADCON0bits.ADON = 1; // Turn on the ADC. // Set ANSEL configuration bits: // <ADCS2:ADCS0> = 101 for 4us TAD conversion time (datasheet recommended for 4MHz // clock). Analog input on AN2 (GP2) set for pulse time adjustment pot, and AN3 // (GP4) for frequency adjustment pot. ANSELbits.ADCS = 0b101; } /**************************** INTERRUPT SERVICE ROUTINE ***************************/ void setup_timer1_interrupt(void){ // Timer1 is a peripheral, so peripheral interrupts must be enabled // (and also global interrupts). TMR1IF = 0; // Clear Timer1 Interrupt Flag. PIE1 = 1; // Enable Timer1 Interrupt. PEIE = 1; // Enable Peripheral Interrupts. GIE = 1; // Enable Global Interrupts. } void interrupt ISR(void){ // Interrupt Service Routine // This interrupt it called at twice the motor (electrical) frequency. // Timer1 has timed out so we must aternate the GP0 and GP1 outputs. // The interrupt activates on overflow, so the starting value of the timer // must be determined to get the correct timer period. Calculations at end // of code. // Here we read and manipulate the last ADC result and initiate the next ADC // conversion. We will perform ADC on the two analog inputs alternately // (one for pulse frequency, and one to control the pulse width) // In reversing the pin polarity, the pins themselves are not reversed as they // might both be 0 (as the expiration of pulse_width_count will set both outputs // to zero). So 'outputs' records the last setting of output pins, and it is // 'outputs' that is reversed. This is then copied to the GPIO pin register. TMR1 = (0xDC00 - F_pot_setting); // Reset TMR1. outputs = outputs^0b00000011 ; // XOR - reverse outputs for GP0 and GP1. GPIO = outputs; // Assign 'outputs' to actual output pins. // Alternately update the Frequency setting (F_pot_setting) and pulse width // (T_pot_setting). if ((outputs & 0x01) != 0){ // Set pulse width. analog_reading = ADRESL + (ADRESH * 256); // Change 10-bit value to 8-bit T_pot_setting = (analog_reading >> 2); // value (max 255). ADCON0bits.CHS = 3; // Change A/D channel to measure Frequency pot // next time around. __delay_us(50); // Delay after channel swap, avoids cross-talk. } else{ // Set pulse frequency. analog_reading = ADRESL + (ADRESH *256); F_pot_setting = (analog_reading << 1); // Mult by 2 to scale to 0x7FE. ADCON0bits.CHS = 2; // Change A/D channel to measure pulse width pot // next time around. __delay_us(50); // Delay after channel swap, avoids cross-talk. } ADCON0bits.GO_DONE = 1; // Start next A/D conversion. pulse_width_count = 0; // Reset counter for pulse width. // GPIO5 = 1; // Turn on LED at GP5 - program running. TMR1IF = 0; // Reset Timer1 overflow interrupt flag. return; } /********************************** MAIN PROGRAM **********************************/ /**********************************************************************************/ void main() { setup_osc(); init_ports(); setup_timer1(); setup_timer1_interrupt(); setup_ADC(); outputs = 0b00000001; // Initialise output pulses variable with pulse // at GP0. GPIO = outputs; // Write to GPIO register. // Turn on LED at output GP5 - program running. while(1){ pulse_width_count++; // Delay chosen so that that 255 (0xFF) __delay_us(28); // increments take up the full 11.4 millsec. if (pulse_width_count > T_pot_setting){ GPIO = GPIO & 0b11111100; // Turn off outputs. GPIO5 = 1; // debug - turn on LED pulse_width_count = 0; // Reset so we don't keep coming back. } // if } // while } // main /* Determining the Timer1 starting value for interrupt for clock frequency: * * The clock I tested needs the outputs to be alternated every 11.43 millisec * for the clock to operate at about the right speed. * The microcontrller clock speed (Fosc) is set to 4MHz in the config parameters * at the start of the program. Timer1 increments with each instruction cycle which * is equal to Fosc/4 = 1MHz, so it increments at 1 microsec intervals. For 11.43 * millisec, the clock increments 11430 times. As the timer interrupts at overflow, * then the timer must start at 65535 (0xFFFF) minus the 11430. * 65535 - 11430 = 54105 (0xD359) approx. * The result from the A/D converter is 10-bit, i.e. 0-1023 (0x00 - 0x3FF). * This permits an adjustment time of about 1 millisec. If I want an adjustment * time of +/- 1 millisec (2 millisec) then I will double the A/D conversion result. * So the timer starting point will have to be about 0xD539 + 0x3FF, so that up * to 2 * 0x3FF can be subtracted from it. So starting point will be about 0xD938. * This is approximate as there will be some latencies in processing the code, etc * The final value will be higher and determined experimentally. So we should * have a range of about 9.4 millisec to 11.4 millisec with the 'correct' * 10.4 millisec setting when the control pot is set to the middle position. * * Determining pulse width: * * The output of the pulse width pot is saved as an 8-bit value: 0xFF (255 decimal). * At lowest frequency, the pulse width above will be up to 11.4 millisec, so we * need the pulse width counter to increment at 45 microsec at a time (45us * 255 * = 11.5 ms. An added delay of 28 microsec resulted in desired increment delays . * */
  2. hr369 replied to hr369's post in a topic in Internet Finds
    I haven't noticed that. All fairlady or just 432? There is one 432 that just keeps expiring and relisting. This is a new one to me. He's willing to export., Overseas people will pay more. Is Edward Lee still in business? He had some red hot deals red hot deals yahoo link
  3. hr369 replied to Gav240z's post in a topic in Interior
    He sent back the radio and made this video. He said it worked good right out of the box. I'm not sure what's going on. It could have been the new RF transistor fixed it and when i retested it, my battery voltage was too low. I don't know for sure. It looks like he cleaned a bit inside the antenna jack but that shouldn't make this much of a difference. I'm now getting radio stations acouple hundred miles away in honolulu. https://www.youtube.com/watch?v=_KGtGCfOufE&feature=youtu.be Some of the 200sx here had radio's with the RN designation.
  4. hr369 replied to DoubleYOOHZ's post in a topic in Help Me !!
    When I lived in calif there were people that had family living in rural areas of calif and they registered their modified cars in those non smog counties. Pain in the butt tho. I'de rather have stock exhaust.
  5. hr369 replied to Dave WM's post in a topic in Interior
    You could probably fix it yourself with a heavy duty thread and a big needle.
  6. If anyone is interested, i've archived over 2600 zcar related pictures on my google drive. link to google drive
  7. hr369 commented on hr369's comment on a gallery image in Miscellaneous
  8. hr369 replied to hr369's post in a topic in For Sale
    Someone already posted the ebay auction of it there. I see a few people i've sold fairlady parts to. I have another box of goodies i'm going to pick up in nov. Anything in there u need? .
  9. hr369 replied to Dave WM's post in a topic in Open Discussions
    Yep, a 78 280z faceplate should fit on that. Good price you got. Nice upgrade too with the 5 pin din and stereo instead of mono which 75 z's had. All you need now is a faceplate and antenna switch. This is the mount they used. Nothing fancy.
  10. hr369 replied to Dave WM's post in a topic in Open Discussions
    Yes you can put an aux in on your radio. You can hard wire it like the guy in this tutorial did. Disclaimer, i haven't done this yet so don't know if it works yet on our hitachi's You can also use one of the universal line in units that plug into your antenna and send the signal over fm. BUT yo're still stuck with mono with that radio you have. ebay link fm modulator The red with blue is the + for the dial lighting when you turn on your lights at night. The ground is the speaker wire with the stripe on it. What model radio is that? I've never seen one that has the red with blue tracer without a black wire also. link to aux tutorial What's really slick is how some people are gutting all the electronics inside their stock radio and putting in modern electronics. The sound quality is much better. Look at that tiny board in there. youtube video of upgraded radio
  11. hr369 replied to Gary L's post in a topic in Help Me !!
    Your options are very limited. Since you're paying someone to fix it then i'de suggest a used exp valve. You already know about the generic evap core and its cost. used exp valve ebay
  12. hr369 replied to Dave WM's post in a topic in Open Discussions
    280z hitachi has the push on. 280z faceplates come up on ebay quite often.
  13. hr369 replied to Dave WM's post in a topic in Open Discussions
    double post
  14. hr369 replied to Dave WM's post in a topic in Open Discussions
    Good job. Sounds like just a cold solder joint. Sometimes transistors test good but are bad. You ever use freeze spray or heat to test? The lighting is really bad in the video. From what i can tell, that radio looks like the ones they had in the 82-83 sentra's and it looks like a very close match to the kms2411 78z radio's i have. I just robbed my km-1821ze for a RF transistor to go in a 240z radio. Love the interchangeablity of hitachi stuff so don't toss it if stops working completely. You might be able to put a 77-78z faceplate on it and attach a 78 antenna switch on the side with sheetmetal screws. I think i saw a 5 pin din on your radio too. I bought a cable on ebay that allows me to use a 3.5mm jack for an iphone or mp3 player.
  15. hr369 posted a post in a topic in Internet Finds
    Only 4 more years until its legal to have in the usa. It's a 35,000$ gamble. Apparently It's easier to fly under the radar in hawaii. Any takers? craigslist ad Thinking of selling my Gtr asking 35k it's a real deal v-spec one of 1650 made in all the years of r33 has a twin turbo rb26 and is rhd! Car is basically stock the only upgrades are hks intake system and full exhaust all the way to the turbos. Car also has water meth injection and is running 15lbs boost on factory Garrett turbos. I just replaced all four tires and added a carbon front lip, timing belt was also done and now has Greddy Teflon belt. Car has cold Ac and currently has 60k miles please don't call and ask questions about how I got it here and legal! Iam very busy and not trying to answer a million questions. Only contact me if your serious and have funds in order or a serious offer or deal proposal!!! Car has a Hawaii title and everything is up to date! Text is best (808)463-404zero
  16. hr369 replied to Dave WM's post in a topic in Open Discussions
    "stereo datsun radio thats coming" You said at the end of your video. What kind of radio is this new one? Your first radio you bought has FET's ? what kind of radio is this? The OE hitachi i have has NPN's
  17. hr369 replied to Patcon's post in a topic in Open Discussions
    I've heard some people baked too long and/or too hot and it screwed up the finish.
  18. Got LED's in those lights? They saved me from a drained battery one time when i went to work and the brake light switch failed and the brake lights stayed on for my entire 8 hour shift. When i came back to the parking lot i thought my battery was drained. It started right up.
  19. hr369 replied to Patcon's post in a topic in Open Discussions
    Some people have baked their newly plated parts in an oven to harden the coating. You mentioned hydrogen embritlement in the first post on this thread but nobody answered your question. Perhaps this may help? finishing dot com website
  20. Good job. I might try clear coating the set on my car.
  21. Ok, this is our version 2.0. of the oscillator. Eric is going to send me a copy and I will try it on different clocks to see how accurate it it keeps time. We have a speed adjustment pot just just like the original oscillator had just in case. Fits nicely in the place where the original smaller circuit board was. oscillator running youtube
  22. hr369 posted a post in a topic in Internet Finds
    Less than 1/2 the price of the Amelia island auction car. I say bargain if the original wheels go with it. yahoo auctions link
  23. hr369 replied to siteunseen's post in a topic in Aftermarket
    red tek 12a is a hydrocarbon refrigerant. Probably propane + isobutane. Have to look at the msds sheet to see what it contains. I ran something similar to this in my 280z called envirosafe. but i must say that it didn't do very well. I then tried r134 and got colder temps. It may be something about my system that makes r134 perform better. I don't know. I tried the recommended pressures and higher than recommended with the same results. I DO run envirosafe in my toyota. Its a 1990 r12 system converted over and it will freeze you out. With a used compressor you drain as much of the mineral oil out as you can and flush it with pag oil. What little mineral oil thats left should mix with the mineral oil. You can try running red tek and see how it works on your system. They say that systems with small leaks don't do well with mixed refrigerants. The refrigerant with the smallest molecules leaks out first and you're left with a poorly performing system. Also, If you're afraid of blowing up in a big ball of fire in a wreck.... a whopping 3-4 lbs of propane gas then do NOT go with red tek. Envirosafe and probably red tek says you don't need to evacuate the system of air but that doesn't make sense. If you've got air in the system displacing refrigerant, that can't be good for the performance. I like to pull a vacuum before charging.

Important Information

By using this site, you agree to our Privacy Policy and Guidelines. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.