Project Updates for 9/14/2010
Sep 14, 2010
I ended up looking at I2C another time, but didn't have any better luck. It just seems to be a protocol that the 2 types of chips aren't able to communicate with. I have been going over the possibility of using the ATmega chip I'll be replacing from the arduino and transferring my algorithms for reading timing over to it, so it would be able to communicate better with the arduino, but it probably won't happen.
I ended up making a change to the prescaler of the timer on the PIC chip. I changed it from 1:1 to 1:8 because after that change, when I converter the values to decimal, I ended up with ...
Project Updates for 9/12/2010
Sep 12, 2010
[img dapa_adapter.jpg||left]I pretty much worked on learning about the hardware for Arduinos and various AVR chips yesterday. I built a parallel port adapter, known as a dapa (Direct AVR Parallel Access) type that connects to the arduino. I had a little trouble at first since I didn't realize the USB cable needed to be plugged in too at first, in order to provide power. After that, it worked fine. Another option for programming the ATmega chips is to use the arduino itself to transfer the code from the computer to a chip sitting on a breadboard. I'm not certain if the Arduino software sets fus...
Project Updates for 9/11/2010
Sep 11, 2010
I finished getting the autodetect function running, so now the chip has the basic program on it that I set out to do a few years ago. For auto detecting, I just looped through 32 times while waiting for the timer to count from 0 to 0xb000 and looked for activity on any pin. If it saw some, it was set as active by just running activeChannels |= PORTD each time. I also took my timing code and made it a little cleaner and more efficient. The entire program is around 1.5KB, though I have 16KB of total space I can use on the chip.I have been kicking around the idea of using the same chip to send ou...
Project Updates for 9/10/2010
Sep 10, 2010
Yesterday I got the code for transferring multibyte data via SPI working. I ended up using the first byte from the arduino to choose which channel I wanted to get data on, which stored the data on the PIC in a static variable, so I could get read multiple times without the number changing and then sending 0xff to get remaining bytes. It works quite well and I was considering setting it up so the first byte was a command, with subsequent bytes being data transferring back and forth. This would allow me to set the PIC up in different modes and allow it more capabilities than I had originally int...
Project Updates for 9/9/2010
Sep 09, 2010
I got my timer code working nicely. I originally kept losing the the high byte of the timer because even though I bitshifted, my timer variable was only 8 bits, so when I shifted the bits over, they would just fall off the undersized variable. As soon as I started reading into 16-bit variables, the problem went away. When I generated my algorithm, I had assumed that the signals for all 6 channels occurred simultaneously. However, upon hooking up 2 channels of my oscilloscope together I discovered they actually occur sequentially, so as soon as one channel ends, the next one starts. An easy way...
Project Updates for 9/8/2010
Sep 08, 2010
I started work on the timing coding. Unfortunately, at this point it's behaving a little erratically. I hooked my oscilloscope up and wasn't able to get any clear reading. So, I decided to try the receiver in the car itself and charged up the batteries overnight. This morning, I connected everything and when I tried to operate it, I had no response. I did notice the car twitched if I shut off the transmitter, so I was pretty sure it wasn't broken. After pulling out the manual, I went through the settings and found it was in QPCM (Quick Pulse Code Modulation) mode rather than PPM (Pulse Positio...
Project Updates for 9/7/2010
Sep 07, 2010
After a lot of fine tuning and tweaking, as of last night, I've finally been able to get the PIC and arduino to communicate without errors. I've noticed that occasionally one of the shift registers gets it's bits rotated on power-up, but a reset of the arduino seems to fix the problem. I'll still look into that so it can work reliably.
The next will be reading PWM values from the receiver. According to documentation and as I've seen on my oscilloscope, the times should vary between 1000-2000 microsecond pulses depending on the direction of the controls. My plan is to have a 16-bit timer consta...
Project Updates for 9/6/2010
Sep 06, 2010
I decided to give I2C a last final effort, which included tons of searching on the internet. The problem is that other than the start and stop bits, the interrupts are never triggered. I double-checked so many things and actually found a few things to fix, although it didn't really make any difference with the results.
So after reading about SPI since last night, I was able to figure out the code for the Arduino and get that programmed pretty easily as a master and set it up to send out data every half second. I did some reading about the PIC and got that set up so it initialized and would dis...
Project Updates for 9/4/2010
Sep 04, 2010
[img workspace.jpg||right]It's been a while since I updated. I ended up putting the logic analyzer onto a circuit board a while back and it works fine. I was still trying to get I2C working between my arduino and PIC chip, but still have been unsuccessful in even the simplest communication. I set up an LCD display that shows what the 1-byte values of up to 4 registers are. I also set up a second chip to attempt PIC to PIC communication via I2C and even hooked up another LCD display to that one, but after further investigation I'm going to look into trying SPI (Serial Peripheral Interface). SPI...
Project Updates for 6/1/2009
Jun 01, 2009
Well, I ended up building a logic analyzer this morning. I found an older laptop that I wasn't using for anything that had a parallel port and I built a simple analyzer out of a parallel cable. The design on the site called for a 74HC245 chip, which I didn't have, so I substituted it with some other chips based on how it was wired up. I ended up using 3 74LS04 Hex inverter chips and paired 2 inverters per input (8 inputs total) to create buffers, which is all the other chip was used for anyhow. However, I needed +5v and the parallel port was only providing about +3v, so I wired a PS/2 cable in...