bluehash

What are you doing right now..?

108 posts in this topic

I'll start. 

I have a Baofeng UV-B5 radio($30) that I use as a scanner and listen to hams in my area. My model comes with a flash flight button which is disabled, but used on a similar model. I came across this link to connect that button to control the LCD backlight on/off, which is great, so I can see the screen at night, and consumes only 10ma.

 

baofeng_uv-b5-flashlight_mod_bacllight_lcd.JPG

Success!

 

tripwire likes this

Share this post


Link to post
Share on other sites

While waiting for my Two-Up from Qu-bd, I am contemplating building a 3D printer from scratch.... got some motors, control board ....

... and that LED - clock project is looking good :-) 

Share this post


Link to post
Share on other sites

Writing a Nokia 1202 driver for TivaWare native C, and debugging it before proceeding to write Newlib stdio stubs so it can take printf() et al.... and pondering a simple "filesystem" concept with those newlib stubs too.

 

Figure the Tiva has the grunt to make it happen.

Share this post


Link to post
Share on other sites

I did not get the filesystem part.

 

Writing a Nokia 1202 driver for TivaWare native C, and debugging it before proceeding to write Newlib stdio stubs so it can take printf() et al.... and pondering a simple "filesystem" concept with those newlib stubs too.

 

Figure the Tiva has the grunt to make it happen.

Share this post


Link to post
Share on other sites

I did not get the filesystem part.

Well regardless, looks like I was successful! :D

post-15991-0-17807000-1390870369_thumb.jpg

 

Anyway, short story is... Newlib implements the typical POSIX crap for stdio, like open(), close(), write(), read() and stdio like fopen, fclose, fprintf, printf ...

 

But the bottom line is, it leaves the implementation of the generics open(), close(), write(), read() etc (a few it needs in addition; isatty() and lseek()) to the end-user.  If you make use of any of the stdio crap like fopen, printf ... GCC will crash with linker errors that it can't find the requisite _open(), _close() etc symbols.

 

So I got a simple driver together (based on something I did for the Renesas RX, based on something else I saw written up about newlib stubs) that takes filenames and provides file descriptors... using a lookup table including struct's that have a const char *name it can compare the "filename" to to see if that driver has what the user wants.  In this instance, the Nokia 1202 driver I wrote responds to filenames "LCD" and "LCDBACKLIT" by running nokia1202_init() and/or nokia1202_backlight(true), then returns STDOUT_FILENO as its return value.  Then running printf("Hi there!") suddenly "just works".  E.g. the pic I just posted :D

 

Here's the TivaWare program I just wrote (a bit ugly since it uses in-line SysTick stuff to implement the RESET delay)-

/* nokia1202.c
 */

// needed for driverlib rom stuff
#define TARGET_IS_BLIZZARD_RA1 1

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/pin_map.h"
#include "driverlib/gpio.h"
#include "driverlib/ssi.h"

#include "nokia1202_drv.h"
#include "ste2007.h"
#include "font_5x7.h"

int main()
{
    MAP_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL |
                       SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);  // 80MHz CPU; speed is calculated as 200MHz/SYSDIV

    // SPI, GPIO config for Nokia 1202 LCD
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    MAP_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_6);
    // Default chipselect state = HIGH (deselect), default backlight = LOW (OFF)
    MAP_GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_6, GPIO_PIN_5);

    MAP_GPIOPinConfigure(GPIO_PB4_SSI2CLK);
    MAP_GPIOPinConfigure(GPIO_PB6_SSI2RX);
    MAP_GPIOPinConfigure(GPIO_PB7_SSI2TX);
    MAP_GPIOPinTypeSSI(GPIO_PORTB_BASE, (GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_7));

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
    MAP_SSIConfigSetExpClk(SSI2_BASE, MAP_SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 4000000, 9);
    MAP_SSIEnable(SSI2_BASE);

    // Need at least 250ms reset + 250ms wait before Nokia LCD is ready to receive commands
    ROM_SysTickPeriodSet(80000*125);
    ROM_SysTickIntDisable();
    HWREG(NVIC_ST_CURRENT_R) = 1;
    ROM_SysTickEnable();
    while (ROM_SysTickValueGet() < 10000) ;
    while (ROM_SysTickValueGet() > 10000) ;
    ROM_SysTickDisable();

    HWREG(NVIC_ST_CURRENT_R) = 1;
    ROM_SysTickEnable();
    while (ROM_SysTickValueGet() < 10000) ;
    while (ROM_SysTickValueGet() > 10000) ;
    ROM_SysTickDisable();

    MAP_GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_6,GPIO_PIN_6); // drive LCD_RESET HIGH pulling LCD out of RESET
    HWREG(NVIC_ST_CURRENT_R) = 1;
    ROM_SysTickEnable();
    while (ROM_SysTickValueGet() < 10000) ;
    while (ROM_SysTickValueGet() > 10000) ;
    ROM_SysTickDisable();

    HWREG(NVIC_ST_CURRENT_R) = 1;
    ROM_SysTickEnable();
    while (ROM_SysTickValueGet() < 10000) ;
    while (ROM_SysTickValueGet() > 10000) ;
    ROM_SysTickDisable();

    // Display ready for init
    fopen("LCDBACKLIT", "w");
    printf("Hi there, using printf!\n");
    //nokia1202_puts("Hi there!\n");

    while(1) ;
}

Main thing to note is the last little part :)

I requested the library initialize the LCD simply by using fopen("LCDBACKLIT", "w");.

Slowly pondering the utility of implementing all my programs using these sort of primitives... like a very lightweight O/S layer for my stuff.

tushki7 and bluehash like this

Share this post


Link to post
Share on other sites

Unfortunately, not much with electronics. Mostly using the temp monitoring system I put together with a launchpad and a bunch of ds28B20's to track down air leaks in my house and fill them. 8 channels on port 2 rather than using the id of each unit. As Arlo Guthery said, "I'm not proud... or tired". Te code is ugly. May post when I get time to clean it up. Not at all efficient, but I whaled it together in a few hours, using a serial LCD i picked up for $1 at radio shack clearance (parallax 16X4line). Way too much timing by delay_cycles.

 

I really don't like 5degF weather.

spirilis likes this

Share this post


Link to post
Share on other sites

I'm contemplating fuel injection on my motorcycle.

My main thread is "EFI", everything else is an interrupt.

:laugh:

 

 

Oh, and I'm also pondering why the NSA didn't start threads like this on 4chan and other forums?

... or maybe they did?

:ohmy:

Share this post


Link to post
Share on other sites

My current "night time coding projects" are:

(1) implementing AES128-CCM cipher for non-aligned frames.

(2) Building a binary serial terminal app in pure, POSIX C for good-old command line shell.  Why is it that all the binary serial terminals are married to one horrible OO graphical framework or another?

 

I do enough hardware stuff during the day.  :)

spirilis likes this

Share this post


Link to post
Share on other sites

Generating gerbers for a super-secret project :)  @@bluehash knows what I'm talking about - unfortunately the rest of you will be out of the loop for a bit!

@@cubeberg : The jagged line maked me guess this is a touch slider. The H on it's side below a C(?) on it's side makes me guess it's some form of HVAC or hottub control. How close am I? :)

Share this post


Link to post
Share on other sites

@@cubeberg : The jagged line maked me guess this is a touch slider. The H on it's side below a C(?) on it's side makes me guess it's some form of HVAC or hottub control. How close am I? :)

@roadrunner84 Close, but yet so far.

Share this post


Link to post
Share on other sites

My current "night time coding projects" are:

(1) implementing AES128-CCM cipher for non-aligned frames.

(2) Building a binary serial terminal app in pure, POSIX C for good-old command line shell. Why is it that all the binary serial terminals are married to one horrible OO graphical framework or another?

 

I do enough hardware stuff during the day. :)

As much as I despise Solaris, the "tip" command was rather nice. I just use minicom under linux but even it uses the fullscreen-terminal ncurses library.

 

Sent from my Galaxy Note II with Tapatalk 4

Share this post


Link to post
Share on other sites

Building up my wireless sensor boards.  It's basically a miniaturized fraunchpad with a 900MHz xbee radio that runs off of a single cell LiPo battery.  The current design lets it mount a CC2541 sensor tag as a daughterboard (shown in the pics).  Was hoping to have it running today, but I ordered the wrong size comparator (MS8 instead of S8).  

post-28692-0-28464200-1390926945_thumb.jpg

post-28692-0-30396000-1390926951_thumb.jpg

Share this post


Link to post
Share on other sites

As much as I despise Solaris, the "tip" command was rather nice. I just use minicom under linux but even it uses the fullscreen-terminal ncurses library.

I don't mind minicom, but I need something a bit more special-purpose.  I suspect it will want to have a GUI someday, but since the meat of it is POSIX C, all the GUI needs to be is the GUI.  That is the only way, I've found, to allow a good degree of independence of platform, independence of library version (I'm looking at you, Qt), and independence from having a damn terminal app that is a 36MB application and eats 100MB RAM.

Share this post


Link to post
Share on other sites

Just got schooled on the ins & outs of fprintf() et al.

 

Apparently by default, when you allocate a stdio handle it enables full buffering, so fprintf() won't show anything... until you run fflush() on the handle.  There's a setvbuf() call that lets you set the buffer (full or line-buffered, where newline triggers an auto-flush) and/or change it to non-buffered mode.

It seems like printf() must issue fflush() automatically at the end of each execution though, so you never see anything wrong when the filedes is STDOUT_FILENO & you use printf() to output, but if you assign the output of fopen() to a FILE ptr and use fprintf() on it (even though it's supposed to be the same as stdout), that fprintf() won't show anything automatically.  Had me confused for a bit.

Share this post


Link to post
Share on other sites

I'll start. 

I have a Baofeng UV-B5 radio($30) that I use as a scanner and listen to hams in my area. My model comes with a flash flight button which is disabled, but used on a similar model. I came across this link to connect that button to control the LCD backlight on/off, which is great, so I can see the screen at night, and consumes only 10ma.

 

attachicon.gifbaofeng_uv-b5-flashlight_mod_bacllight_lcd.JPG

Success!

 

I just bought a Baofeng UV-5RA to monitor until I get my license.  Great little unit for $30!

Share this post


Link to post
Share on other sites

Playing Hay Day.                           And regenerating for new and exciting year.

 

 

Oh, and trying to make enough money to buy this thing (you MUST read reviews.)

tripwire and spirilis like this

Share this post


Link to post
Share on other sites

Oh, and trying to make enough money to buy this thing (you MUST read reviews.)

Quick! It's $5000 off and there's only one left in stock!

Share this post


Link to post
Share on other sites

Oh, and trying to make enough money to buy this thing (you MUST read reviews.)

Should go alright on a pi, but where's the challenge in just plugging in a hdmi cable? Who's up for hacking an interface then writing an Energia library?

 

 

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites

I have a Baofeng UV-B5 radio($30) that I use as a scanner and listen to hams in my area. My model comes with a flash flight button which is disabled, but used on a similar model. I came across this link to connect that button to control the LCD backlight on/off, which is great, so I can see the screen at night, and consumes only 10ma.

 

I just bought a Baofeng UV-5RA to monitor until I get my license.  Great little unit for $30!

 

Seems to sell like hotcakes, the UPS man just dropped a Baofeng UV-5R+ on my doorstep :) I hope to use it as a test signal  to fiddle with my AIS project. (Carrier signal only, I don't think it is able to transmit data)

 

Besides that, I successfully put my $2.50 reflow oven into production. No more handsoldering of QFNs.

post-9974-0-99321800-1390949395_thumb.jpg

Heat 0.25" aluminum slab to 160C (gently, it should be stable at 160C or only slowly increasing), add aluminum tray with PCB and temperature probe inside, cover with 2nd tray, wait till PCB reaches 160C plus another minute or so, turn up the stove to max, wait till PCB reaches 220C, take tray off the stove and let cool, season to taste.

 

zeke, RobG, roadrunner84 and 3 others like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now