2009-05-24

Solar Cells testing

This Sunday the sky was clear and the Sun strong, so I decided to check some of the solar cells I had in my components box. I have two types from solarbotics (this one and this other one) and other from pagermotors (this one).


All the cells are up to specification although I only tested them on open circuit voltage, it was too hot and too bright to do a test load. I also have no reason to believe the cells won't perform as specified.
I have two ideas for them:
  1. use one or two white bright LEDs and a couple of batteries to build a "light hours" extender for my chili peppers. I haven't decided yet if I'll use a micro-processor or I try to build a fully analog control system. Either way it will be quite complex as it involves two switching power supplies (charge batteries and supply LEDs) and some operation decision. I'll call this project the "Solar-Extender".
  2. revise the Mousebot to include a solar panel and a couple of rechargeable batteries, this one will definitely have a micro controller. It should harvest the sun and charge his batteries and when the sun is out it should hide in the darkest and coolest place of the house. Put some "simulated annealing" when it wake's up or goes to sleep in order to let him fool around and find some better places. This project I'll call the "Solar-Bug".
I hope to finish these two projects before the end of the summer, as from then on either the behavior of both the projects will be pushed to the maximum efficiency as light-hours decrease towards the winter-equinox.

8085 DRAM interface (30 pin SIMM)

After seeing this project on Make (or here) I felt like old DRAMs could have a better use... It is a bit sad that so much technology and development by semiconductor engineers and computer designers goes "wasted" on a light box. The light box looks good, don't get me wrong.. but.. so much engineering wasted in a light box... doesn't look right.
I always thought that using these SIMMs in microprocessor applications would be interesting and with the proper memory management it could be used with old 8 bit microprocessors. The likes of Z80, 8085, 6809, 6502 could go with a simple DRAM interface.
Trying to search for information online or even in books, application notes etc is quite elusive, there are three good sources of information:

  • This one (or here in pdf) is very specific regarding the Z80, and Z180...[...]

  • This one with a PIC processor connected directly to a DRAM chip (source code only).

  • And this one, where a FPGA and a 8051 microcontroller are connected to a 72 pin SIMM.

  • Most of the microprocessor or microcontroller projects online either use one or more large SRAMs (128K,256K and 512K bytes) are these are nowadays readily available.

    Although my projects don't need a large RAM size I wanted to probe the use of old SIMMs with the 8085. The Z80 makes it all a bit more simpler because it has been design to use DRAMs, so at the end of the instruction fetch cycle the RFSH and MREQ signals go low, the problem with this that the instruction fetch cycle is slightly (half cycle) shorter (see here).

    It seems logical the one would try to do the same in a different processor, while the processor is decoding and executing the fetched instruction the DRAM controller preforms a DRAM refresh, this way every instruction fetch a refresh is performed which normally is often enough. Except, in the 8085 case, if the processor is halted. The Z80 solved this problem by still performing instruction fetches during HALT (it executes NOPs). I decided to carry on accepting this problem and do not write any programs that halt to processor unless I want to lose the contents of the DRAM.

    In the 8085 there's no refresh cycle, but at the end of every instruction fetch, during 1 to 3 cycles (depending on the instruction just fetched), the CPU relinquishes the bus, these are called T4,T5 and T6 states (see here). Although a single cycle for refresh might not seem a lot, one could extend the cycle a bit more until ALE goes high, from then on the address on the bus is valid and a normal fetch should be made.

    The 8085 does have an slight advantage when compared to the Z80 (and Z8000), the read signal and write signal (RD and WR) are active for the same time weather in instruction fetch, memory read and or memory write (and even I/O these are extended in the Z80), so there's no need for a early-write signal when using the SIMMs.

    I designed the circuit as a combination of two sequential circuits, one generating RAS, CAS and Address inputs during a normal read/write and instruction fetch (accessing), and another circuit for refreshing the RAM on every instruction fetch (refreshing). During a instruction fetch from a non-selected memory the last cycle is used to do a CAS before RAS refresh, if the fetch is done from the DRAM, the access cycle is extended to do a hidden refresh (toggle of RAS line while CAS is low). When ALE goes high all DRAM access activities stop and the circuit waits for RD or WR to go low to start the RAS/Address Mux/ CAS sequence. I use the X2 output from the 8085 because it is at 2 times the CLK output, therefore it allows faster state switching and a longer memory access time.


    I've designed and assembled the circuit and I'm about to do extensive testing if it really works or not. Here's the schematic of the CAS/RAS generation, the connection to the SIMM is straight forward, the pin-out of a 30-pin SIMM is here, and some of the history of SIMM development is here.


    The 8085 is clocked at 8MHz, and on the oscilloscope RAS appears on top and CAS on the bottom. My only problem has been my EPROM emulator, and I need to do something about that in the future. It is only working in DOS... So now I need to do all the programming in DOS and test the system with the oscilloscope. I'm also using the SOD line to trigger the oscilloscope when the SIM instruction is executed, the current program is the following (beware, 8085 assembly follows):

    .title test_program 0
    .sbttl testing

    .area ram(abs,cseg)

    .org 0x0000
    reset:
    di
    lxi h,0xC000
    lp000:
    mvi a,#0xC0
    sim
    mov a,m
    jmp lp001
    lp001:
    mvi a,#0x40
    sim
    mov m,a
    jmp lp000

    SBC6120 Update

    This weekend I started with the finishing touches to my SBC6120. I found what appears to be a "suitable" casing for the board, a power supply and the disk drive.
    I would like to build inside a 12V and a 5V switching power supply from a 16-24V DC input, this power supply would allow the system to support either common 3.5 inch IDE drives or the smaller 2.5 inch laptop IDE drives (5V only).
    I also need a power switch, a reset switch, access to the status indicators and a DB9 serial port connection.
    For now I'm using a 1.4 inch IBM X40 drive and everything appears to fit. I would rather have a bit more room, but the next available case was too big.
    I haven't gave up on finding the "best"case, but for that I still need to find a suitable power supply, a some nice looking panel switches (ON/OFF and RESET) and the serial connector.
    An old chopping board is not the best background for an electronics project... but then again.. It's what I had at hand..

    Follow up on Balcony garden

    Our vegetables have been growing steadily for the past two weeks. I've been moving some of the sprouts that were born in the yogurt cups to the bigger vases, but now I don't have any more space. On some, instead of removing them from the cup, I just cut the cup bottom and push them into the vase.

    I learned that carrots don't like and should not be moved! No wonder now that they took so long to adapt, on the other hand tomatoes, kale and the celeriac don't seem to bother being moved and are developing nicely.
    On the "battle of the veggies" I seem to be up front in the kale, celeriac and carrots, unfortunately my tomatoes look like little dwarfs compared to Ana's..

    Last week my kale reached some "maturity" and before it became too hot to eat a soup we decided to try doing a caldo-verde.

    We used some of the bigger leaves of our kale to do it, with some "chouriço" and bread, hum ... delicious...