Jump to content
43oh

?Terminal


Recommended Posts

[update]

have text displaying in 3 sizes now (1,2,and 3 bytes tall, although the 2 and 3 byte tall font takes up a CHUNK of memory for the bitmaps (around 1.5k for the 2 byte tall, and around 3k for the 3 byte tall.  so if all 3 sizes are enabled then it takes up about 5k of memory.)

 

also have preliminary work done on displaying an image at an arbitrary pixel height.  but the display breaks sometimes when you feed a certain byte into the image data.  and it makes no sense, the display code is exactly the same, and it isn't a timing thing.  so I'm stumped :-(

see the most for more info :)

 

Video of the ball bouncing around  you can see the byte boundries by the black box that follows the ball around (this is the true "image" being written to the screen, im just reediting it every frame to move the image within the image.

[/update]

ok, got the screen brightness sorted out with the help of Bluehash.

 

Here is the ? terminal booster running on the ? launchpad platform.  powered by a 100mAh lipo battery.  the screen is the same one from "the Terminal" oled booster that bluehash made.

 

battery charging works through the USB port.

 

I am going to get the program written so it does more than just display its name. but I need to figure out the bit graphics used in the icons.h file.

 

the entire ? booster, and ? LP hide behind the screen itself.  next version of the booster will have a tab so you can wear the thing like a nametag :smile:

 

side view post-7036-0-12937500-1379784484_thumb.jpg

front view post-7036-0-21052900-1379784485_thumb.jpg

 

I will run some tests to figure out current draw to see how long the battery will last, and maybe modify the current resistor to dim the screen to lower current if I need to.

 

post-7036-0-76422100-1379784481_thumb.jpgpost-7036-0-10842200-1379784483_thumb.jpgpost-7036-0-07050000-1379784486_thumb.jpg

post-7036-0-52034400-1381882925_thumb.jpg

post-7036-0-24883900-1381882932_thumb.jpg

post-7036-0-26630100-1381882937_thumb.jpg

post-7036-0-12063100-1381883211_thumb.jpg

post-7036-0-09766100-1381883637_thumb.jpg

Link to post
Share on other sites

this is coming together nicely.  cool project man!

 

so, what's the deal with the current resistor anyhow?  datasheet i got is super vague.  i've just stuck with whatever was in the reference design, and adjusted in software.  wonder if you could use a photodiode there to compensate for ambient light without processor intervention...

Link to post
Share on other sites

ok after running a current draw test,  it started faulting out at 10 hours of run time when the battery was at 3.6v   I'm pretty sure the LDO i put on it was a 3.6v reg cause the regulated VCC side was 2.7 ish but swinging all over the place rapidly so im pretty sure the LDO was shutting down under its voltage or something...  I have 3v vregs for it which "should" have been what went on it, but I checked the tape and none of the 3v regs have been taken out yet so I'm not 100% what I grabbed to put on the board ???

 

anyway this is was with the processor not allowed to go to sleep,running my animated logo on the screen...  3.6v is about half way drained i think for a lipoly battery, but since the load was light, i think it skews flatter, so I won't know for sure till I put that 3v reg on it.

 

here is the video I took part way in.

http://www.youtube.com/watch?v=x5SBEy2QCEY

the animation is done by a timer timing out 30 times a second and displaying the next "image" in the animation.  I found a program that will convert a monochrome bitmap into the hex array that the MSP430 code can feed right in, so it was just a matter of doing the graphics...  I like it

 

interestingly when the battery was fully charged it was drawing 11mA, and when It was still going at just above 3.6v it was only about 7.6 mA  I would have thought the current would go up cause the regulator was trying to maintain its voltage output...  but don't know.

Link to post
Share on other sites

LDO won't maintain a voltage when the source is below its target, it'll bleed off heat to keep the voltage from going any higher than its target, and the current won't change... i.e. 3.6V LDO supplying 11mA to the target will draw 11mA from the source, e.g. a 3.7V battery, and dissipate the difference -- 0.1V times 11mA (or 1 milliwatt) -- as heat.  But when the source voltage drops below the target, the LDO will just pass it through with a very tiny voltage drop (thus the term "low dropout" voltage regulator).

 

Switching DC-DC Boost converters will ramp up (or down) current as needed to maintain a constant voltage.  A good part for this, btw, is the TI TPS61221 ... used it in my grill monitor with 2xAA batts to maintain the 3.3V needed for the thermocouple chip, and it has been flawless.  Very low quiescent (waste) current draw, around 9uA I think 5.5uA according to the page.  It needs a few extra parts including an inductor (though the one I use is a small 1206-sized one) and enough capacitance.  Offers up to ~150mA or so if the source battery can swing the up-to-400mA periodic current spikes required to keep the boost effect going.

 

Another nice thing about the TPS61221 is it'll protect the target from higher voltages e.g. up to 5.5V ... it'll moderate its switching rate to prevent the MSP430 from seeing that.  It's a tiny package, but solderable by mere mortals as it has a 0.65mm pitch just like the TSSOP chips.

Link to post
Share on other sites
  • 2 weeks later...

playing with the software for it, I rebuilt the text display routine to accept fonts that had variable spacing for each character (the example program only had the 8x6 pixel block letters)  and also it can run fonts that take up multiple bytes vertically.

 

I plan to implement vertical scrolling as well, but don't have that done yet.  as an extension of vertical scrolling I am working getting sprites to move smoothly in the vertical direction, as right now they can only display on the whole row numbers (1byte tall, 8 bytes total display, so only 8 vertical positions)  I am going to have the MSP resample the byte array and build the new one with the proper pixels where they need to be.  After that sprite transparency (for the outline mask so they can be other than square sided shapes)

 

anyway I have it down pat on digitizing fonts, it takes about a minute or so.

 

here is the display using 2 different 2 byte tall fonts. (one is called "Segoe Print" in windows, and the other is "italicT" )

 

longterm I am going to have some sort of playable game, with sprite characters probably in a side scrolling shooter format.   well see though 2 colors are limiting.

 

the downside to the 2 byte tall fonts is they take up a chunk of memory.  the italicT one takes up 1668 bytes, and the segoe one takes 1308.  although they only compile into the program if you use them, otherwise they are optimized out.

post-7036-0-53487100-1380946054_thumb.jpg

Link to post
Share on other sites
  • 2 weeks later...

[update]

have text displaying in 3 sizes now (1,2,and 3 bytes tall, although the 2 and 3 byte tall font takes up a CHUNK of memory for the bitmaps (around 1.5k for the 2 byte tall, and around 3k for the 3 byte tall.  so if all 3 sizes are enabled then it takes up about 5k of memory.)

post-7036-0-15651400-1381883855_thumb.jpgpost-7036-0-56698900-1381883861_thumb.jpg

 

also have preliminary work done on displaying an image at an arbitrary pixel height.  but the display breaks sometimes when you feed a certain byte into the image data.  and it makes no sense, the display code is exactly the same, and it isn't a timing thing.  so I'm stumped :-(

post-7036-0-63999500-1381883882_thumb.jpg

post-7036-0-43392000-1381883866_thumb.jpgpost-7036-0-86432000-1381883873_thumb.jpg

Video of the ball bouncing around  you can see the byte boundries by the black box that follows the ball around (this is the true "image" being written to the screen, im just reediting it every frame to move the image within the image.

 

 

here is my image display code

void imageShift(char IMAGE[], char ImageOut[],char Ishift, char IRowIndex){
    char IColumn = 0, width = IMAGE[0];                        //load image width
    int ImageScratch;                                        //make 16bit scratch pad
    if (IRowIndex == 0){
        for (IColumn = 0; IColumn < width; IColumn++){        //cycle through each image column
            ImageScratch = IMAGE[2+IColumn]; //copy 1 byte of image data to the scratch pad
            ImageScratch &= 0x00FF;
            ImageScratch = ImageScratch << Ishift;         //shift the scratch pad by the shift amount
            ImageScratch = ImageScratch >> 8;         //swap bytes to put the image data in the lower byte
            ImageOut[IColumn] = ImageScratch; //move the shifted image data to the output array
        }
    }
    if (IRowIndex == 1){
        for (IColumn = 0; IColumn < width; IColumn++){        //cycle through each image column
            ImageScratch = IMAGE[2+IColumn]; //copy 1 byte of image data to the scratch pad
            ImageScratch = ImageScratch << 8;         //swap bytes to put the image data in the upper byte
            ImageScratch += IMAGE[2+width+IColumn]; //add 1 byte of image data second row to the lower byte of the scratch pad
            ImageScratch = ImageScratch << Ishift;         //shift the scratch pad by the shift amount
            ImageScratch = ImageScratch >> 8;         //swap bytes to put the image data in the lower byte
            ImageOut[IColumn] = ImageScratch; //move the shifted image data to the output array
        }
    }
    if (IRowIndex == 2){
        for (IColumn = 0; IColumn < width; IColumn++){        //cycle through each image column
            ImageScratch = IMAGE[2+IColumn]; //copy 1 byte of image data to the scratch pad
            ImageScratch = ImageScratch << 8;         //swap bytes to put the image data in the upper byte
            ImageScratch &= 0xFF00;
            ImageScratch = ImageScratch << Ishift;         //shift the scratch pad by the shift amount
            ImageScratch = ImageScratch >> 8;         //swap bytes to put the image data in the lower byte
            ImageOut[IColumn] = ImageScratch; //move the shifted image data to the output array
        }
    }

}

void imageDraw(const char IMAGE[], char row, char column)
{
    char a, b, IRowIndex, height, width, shift;
    row += 60;
    shift = 7-(row & 0x07);
    row = row >> 3;
    //row += 4;

    width = IMAGE[0];
    height = IMAGE[1];
    IRowIndex = 0; // Image Row Index, 0 = first row, 1 = middle rows, 2 = last row, or single row image.

    for ( a = 0; a <= height; a++)
    {
        if (a == 0){IRowIndex = 0;} else {IRowIndex = 2;}
        if (a == height - 1) {IRowIndex = 1;}
        if (a>0){b=a-1;} else {b=0;}
        imageShift((char *)IMAGE+b*width, (char *)scratchImage, shift, IRowIndex);
        if (row+a < 16){
            if (row+a >= 8){
                setAddress(row + a - 8, column);
                SSD1306SendData((char *)scratchImage, width);
            }
        }
    }

}

[/update]

Link to post
Share on other sites

when I get time away from school project I will rewrite the font handler to allow inclusion of subsets of characters (numbers, symbols, and characters seperately, this will cut back on the size)

 

I "MAY" also try a 2-1 compression on the big font so it takes up half or less the room, but looses resolution at display.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...