0xEE.net UART / Weekend Tinkering

We did it,  0xEE.net is live. Our first post is a very detailed look into the PIC UART. This article is a stepping stone for other projects we have lined up. Tell us what you think!

Sunday Morning Tinkering

In other bits I haven’t had a lot of time to do other things, I have been busy building two dev boards and write code for the above mentioned article but my Saturday was spent helping my sister and wife at their yard sale. It came away with a surprise for my daughter and an old Pelco dome camera. Video is a lot more interesting to look at on a scope than it is on an SA.

I also hacked up a super simple camping nightlight for my daughter. We are going camping the weekend after father’s day. I tore a cheap-o handheld temperature gun apart to get the thermopile and had a bunch of spare parts. The battery case and backlighting for the LCD will make a nice nightlight. No switch but she kills the batteries anyways as  her flashlights never get shut off. I’ll have to grab some rechargeables..

camping_nightlight

I hope you all have a pleasant memorial day weekend. I thank all my fallen military service family, and their families for their service and their sacrifice.

A long week of mouse hacking and projects

I’ve been a little busy on the workbench lately. I’ve been working late at the-day-job so I’ve been neglecting my workbench notebook and my blog for most of this week. I’ve got a ton of “fun” stuff planned for this weekend; no way I’ll get it all done.

I won’t make you read through the whole post if I pulled you in with mouse hacking 😉

I am a poor gamer.. give me a cheat code and I’ll use it. I have no shame in gaming. Adam Fabio recently got me slightly addicted to ClickingBad … I refuse to link it, don’t search for it.. it’s a god-awful time suck. I clicked a freakn’ mouse for 90 minutes straight… Well screw that. I pulled out one of those el-cheapo USB mice you get with a refurb computer… the $5 throw-away kind. I popped it open and as luck would have it little microswitchs on a single sided PCB. Well 2-1/2 minutes later I had soldered wires to the switch contacts, dumped them on the normal open contacts of a small relay,  hooked it up the relay coil to my MOSFET driver (yes, way overkill, it was laying there already), and threw it under a PIC. I used a rate of 70 ms off 40 ms on.. I probably could have sped that up but it was at that warp speed, I was happy. Did it take away from the game? Nah, I had that much more to buy! I was shocked the relay held out for a few days of being hammered (“Batches hand-cooked: 1.01Q” , that’s not a quadrillion clicks, but it was a lot regardless). I pulled my cheat-clicker off after a while because the super-fast click of the relay was getting pretty damn annoying. I had little bug in the system: a little phantom drift issue with the el-cheapo mouse so turned down pointer sensitivity to as slow as possible; That allowed for a couple hour stretch of non-stop cheating.

Mouse Click Hack

Continuing on with actual electronics projects: I have five active projects I’m working on, a few I’ve recently benched waiting on a big purchase, trying to get other stuff out of the way or for other reasons.

1. Video Synth … Lawrence has inspired me to help him build a Video Synth. I’ve gotten a fair amount of reading done. Looks like I’m going to need a spectrum analyzer for some filters I want to build (awww darn! heh). I’ve gotten some boards finished which I needed for other projects but just happened to work for this one as well.

 

Sweep Generator -- Opps I forgot something
Sweep Generator — Opps I forgot something

… version 2.0 of these boards in at the fab. I’ll probably sell some of these for people needed a quick sweep generator for their VCOs, etc.

 

2. Workshop Time Standard  — Just started this because I got most of the parts in. This will be powered by my MikroElectronika PIC clicker and GPS2 click…. Stay Tuned.

3. WWVB for non-US persons… Edward contacted me about using my WWVB project but to actually broadcast the correct time. Well, fair enough. This has gotten me to buy all the stuff I think I need to create a PIC NTP client, GPS NMEA input .. and then the easy part. Broadcast it on 60KHz… I’ll have some kind of notice you should do this in a lead box under the ocean. I certainly wouldn’t sell this to someone within the US. I don’t think the FCC has any rule that allows a person to broadcast any tiny amount of power on 60KHz, certainly not intentionally. I didn’t find anything I thought I’d be safe under Part 15. I’d love to be proven wrong on this.. really.

4. My electric scooter. I just got a welder … now for some more material. Most of the electronics are done-enough until testing.

5. My ESR meter… waiting on parts of course.. come on Customs.. let me have my fun-stuff.

… all this work has left me bench a disaster zone.

 

The Great Mess of April 2014
The Great Mess of April 2014

 

.. I’ll finally leave you with this fun photo:

Ohm's law
Ohm’s law

The @JohnS_AZ Blogger Guilt Trip

There is a lot of content out on the internet… a lot.. but it’s amazing how much of it you can burn through on a day full of programming. I started picking up a couple more podcasts just because I’ve been running out my normal subscriptions. I started listening to ZombieTech; a podcast made by the @tymkrs… entertaining and informative. I finished listening to Episode 003 with John (@JohnS_AZ) this afternoon and it really made me think about my content as a blogger. My blog isn’t intended to be a “build this” or “this is how you do it” type of blog but I feel John’s message still applies. If I come along a blog or project site of some sort, more than not, the media describing the project is usually lacking. In the case of YouTube videos, sure.. we get so see the LEDs blink, but there is usually no circuit review, code provided, or schematic provided in PDF. John mentioned how a video of circuit explanation would be helpful for those who want a little more information in line with something like a blog entry that includes some code and description.  I whole heartily agree with him; I’ve also found myself wishing there was more information in an article countless times. So now I have a little guilt now over being a very sloppy blogger. I can do better, even though I’m not writing articles to generate content, nor am I suggesting readers might be interested in building whatever I am; regardless, I’m demanding of myself to do more do-diligence before posting… maybe comment my code better and certainly it’s easy to do some small uncut YouTube videos… even if it’s rocked out on the iPhone. Don’t get me wrong though, you won’t be getting schematic out of me much because I usually don’t build-by-schematic. I will offer you this though: If you’re looking for some content on older blog posts I’ll be happy to go revisit the project and offer an update. Most if not all my blog posts are of snippets of information that are generic enough that you can re-use what I’ve done in something you’re working on. I don’t think I’ve actually posted any “complete” work to date; I imagine that’ll be a rare day when I do.

So thanks for giving that interview John, it was definitely insightful. I look forward to seeing what your HackersBench.com site turns into.

WWVB Time Signal Generator Test w/ HEX

[Edit: I’ve added the .asm code in the “Code” page in the menu above. Below you can find the .HEX file for easy programming]

A successful test on my WWVB signal generator. I’m going to shy away from calling it a transmitter because I don’t think there is any allowances for any broadcasting on 60KHz, so to stay legal I would imagine you’d need to conform to part 15, shield everything, use an attenuator and dump the signal into a shielded box with the clock? I somehow doubt the FCC checks up on sub-mW transmissions on 60KHz though.

The concept is simple, 1 baud rate transmission of a 60 frame packet. The amplitude shift keying (ASK) system WWVB transmits is recreated using a CMOS CD4066 switch. Dump a 60KHz sine wave (keeping in mind maximum input/output signal specifications) into one of the switch ports. Use the output on PORTB.0 of the PIC to control the switch and the other side of the switch goes to you device under test (I used a couple feet of wire as an antenna and just placed the wire in the neighborhood of the clock receiver). It’s a no brainer. Check out the NIST site on WWVB if you want more details. I’ll probably re-port the code to a 12F629 when I get my new PICKit3 in and I’ll likely build a board with a 60KHz generator.. maybe I’ll even sell it on Tindie if I’m feeling ambitious.

The Test! I was getting my ass kicked earlier this week as my circuit was not working and it seemed like everything was just right. It did force me to really tweak my timing to make it within my range of error on being able to measure the exact pulse widths, I don’t know how precise it has to be but I assume that’s up to the algorithm decoding the signal. Turns out it wasn’t my code or circuit.. My $15 Fred Meyer “black friday special” atomic clock doesn’t work. It won’t receive the real WWVB (set up aligned with Boulder, CO away from electronics, blah blah). I was getting the proper signals out of the module, so I yanked the module out of the clock and hooked it up to a receiver designed by N0QBH. I mirrored his project here. He has a website for the project here. I used his schematic, ditched the need for the LCD and just grabbed my data off the RS232. Done! You can see a before and after output screenshot in the photos below.

My WWVB signal generator code (HEX) for a 16F628A is found here . Is it lame of my just to provide the HEX? yeah…. but all you need to do is hook up PORTB.0 to switching input of a 4066 with a signal generator feeding a 60KHz sine wave and you’re in business. (And a resistor pulling /MCLR (PORTA.5) up as well if that wasn’t obvious? I’m using the internal oscillator; no xtal needed).  You are stuck with my fixed date of course.. which is why you want my assembly code right? No problem. Just ask… really (comment or e-mail). I don’t want to post it because I don’t really like comment trolls. This code is super BETA but at an acceptable starting point. Lots of opportunity for optimizing it as well.  Why didn’t I improve on this code? Because I don’t need to. I’m just using it to test receivers I’ve purchased from the UK and I’ll be working on a project with those in a little while.

My time/date is static here is a snippet of the main line code:

    CALL    MARKER                      ;MARKER FRAME REFERENCE BIT
    CALL    ONE                         ;40min
    CALL    ZERO                        ;20min
    CALL    ZERO                        ;10min
    CALL    ZERO                        ;Reserved
    CALL    ZERO                        ;8mins
    CALL    ZERO                        ;4mins
    CALL    ONE                         ;2mins
    CALL    ZERO                        ;1mins
    CALL    MARKER                      ;MARKER 1

… and so for some photos

signal from PIC before ASK modulation accomplished by switching a CMOS CD4066 with a 60KHz sine wave from a frequency generator.
signal from PIC before ASK modulation accomplished by switching a CMOS CD4066 with a 60KHz sine wave from a frequency generator.

 

WWVB receiver module removed from clock

The clock with the module removed, luckily they printed the pin diagram on the board. 5V, Gnd, PON, and TCO

WWVB Signal Generator and Receiver on Breadboard

Both the generator and receiver on the breadboard. The transistors form the RS-232 driver for the receiver.

Before and after on the RS232 output of the WWVB receiver
Before and after on the RS232 output of the WWVB receiver

 

VFD Update: In Precharge / Configured

Slowly chiseling away. I got the terminals set up, all the motor set up, disabled most faults in advanced configuration and I now have the drive out of fault, temp sensor back working, and ready to drive waiting on the DC bus.

I think if I read the manual right with my configuration that should be about 370VDC, but I guess we will see? The VTAC9 Rockwell Automation manual is really detailed in some regards but lacking in regards to technical information. Not surprising after looking at the set up the VTAC controller has no idea it’s missing the AC input. The drive does start up right at about 196V on the DC bus … if you have to get one running just enough to configure it. I could/did configure the drive for a lower motor voltage but I won’t know if that effects the requirement for the DC bus; I doubt it.

Now.. I just need to suck it up and buy some batteries. I put in a big order with @Digikey but it’s all subsystems stuff. I’ve never worked with CAN before but the new Elektor has a article about a CAN tester and it interested me enough to try it out.

I also noticed @Sparkfun has a neat little bluetooth module out that I was considering picking up for $59 .. but then they also have a “Silver” one that’s $39 and has 3.3-6V input both Vcc and inputs. They’re small and are set up for TTL level RS-232. My current module is larger, has a lot of pins I don’t use (although I do like the handy link output).

With all this need for HV DC I’m seriously considering building a home-brew HV power supply. You have probably seen my bench I have some cheapo Elecnco 0-20/5/-12/12,  a B&K 1601, and some miscellaneous other fixed sources. I have my eyes on a B&K 9124 and a B&K 9110 (tear down: http://www.eevblog.com/forum/reviews/bk-precision-9110-60v5a-100w-psu-review-%28with-pix!teardown%29/ ).

VFD waiting 'In Precharge' after configuration.
VFD waiting ‘In Precharge’ after configuration.

VFD Update: AC retrofit to DC, Drive Start Up on DC bus.

I said I was going to wait until I had enough batteries to start this drive up but I decided I couldn’t wait. I took a 110VAC to 42VAC power supply that was lying around and fed that into the secondary of the fan transformer (690VAC tap). Through an undersized bridge rectifier I need to change out if I’m going to use it for longer than a brief start-up (400V, yes technically big enough but..). The drive started on it way up to 220VAC as the capacitors charged. I didn’t allow it to stay on long because I have no fan and I got a over temp alarm though, I think it’s not right, 110 deg C. I must have wiggled a cable out? I’ll look around as I think I know where both sensors are found.

So there it is, started up. I have a lot of reconfiguration to do to the drive to get it to run on low DC bus voltage. I was reading the manual and I think I can cheat it down…. I certainly don’t want a 680V DC bus as that’s a lot more batteries than I was planning on.  I haven’t decided if I’ll be running it by potentiometer, 0-10VDC or 4-20mA control signal … I should probably figure out how I’m going to physically request/actuate a speed demand before I decide.

Next steps: 1. Attach DC fans for the heat sink, provide a more securely wired input, configure settings…

Note: 110V  42VAC transformer fed to 110V480V transformer, rectified to supply to 220VDC. The VFD powers up in the 200V neighborhood.
Note: 110V 42VAC transformer fed to 110V690V transformer, rectified to supply to 220VDC. The VFD powers up in the 200V neighborhood.
Below is the 80W power supply board and then above that is the IGBT board with capacitors to the right.
Below is the 80W power supply board and then above that is the IGBT board with capacitors to the right.
%d bloggers like this: