nuxx.net
Making, baking, and (un-)breaking things in Southeast Michigan.

Basic Help, Please.

I’m having some problems with a subroutine in the small program I’ve been working on mikroBasic for the Honda Music Link stuffs I’ve been doing.

Could any of you help me?

To start, here’s a copy of the program in a text file: hml_mikrobasic_help.txt

Here’s the project itself, zipped up: hml_mikrobasic_help.zip

The IDE / compiler itself, mikroBasic, is available here.

(I’m just using the demo version, and the limit is only on code size, so feel free to install it. I don’t come anywhere near the code limit, and when one does it’s rather obvious, as the compiler just refuses to compile it.

The problem I’m having is with sendCommand(), and specifically the variable iPodCommand, which is the first one passed to it. What I expect to happen is that whatever is passed as the first argument to sendCommand() will be set and available within the procedure. Instead, I seem to be getting something else.

As the program is currently listed, I would expect the output sendCommand(powerOn, 0) to be 0xFF 0x55 0x04 0x00 0x00 0x00 0x04 0xF8. However, the output I receive is 0xFF 0x55 0x02 0xFE 0xB9 0x47.

The expected packet is broken down as follows:

0xFF – Header 1
0x55 – Header 2
0x04 – Data Length
0x00 – Data 1
0x00 – Data 2
0x00 – Data 3
0x04 – Data 4
0x08 – Checksum (0x100 – Data Length – All Data Packets)

The received packet breaks down this way:

0xFF – Expected Header 1
0x55 – Expected Header 2
0x02 – Length appropriate if the constant referenced by iPodCommand were two bites in length.
0xFE – Data 1 (Not sure where this comes from.)
0xB9 – Data 2 (This one neither…)
0x47 – Checksum, calculated properly off of unexpected Data bytes.

When I run things through the hardware debugger I’m not seeing the variable iPodCommand as an array, and I’m not sure why or how (it just shows a value of 0xDF). That, though, and it’s not working as expected, is leading me to believe that I’m doing something wrong in setting up sendCommand().

So, could any of you please help me? I just don’t know what I’m doing wrong.

Thanks!

computerselectronicsmoved from livejournal

PICkit Serial Analyzer

It appears that Microchip will be making the PICkit Serial Analyzer available after May 8th, at a list cost of US$49.99 (with demo board). It’ll read and write I2C, SMBus, SPI, and USART.

I may have to acquire one of these instead of a much larger scale logic analyzer.

UPDATE: Gur, I’m dumb. I just read the docs and realized that it’s not a analyzer, more a USB tool which will communicate as I2C, SMBus, SPI, and USART. I can’t use it for sniffing / capture.

acquired thingselectronicsmoved from livejournal

HobNobs

HobNobs!

Plain HobNobs, my favorite biscuits.
(Click for more moblog photos…)

Thanks, Jungle Jim’s. I now have plain HobNobs, my favorite biscuit. I wish the normal importers brought them in, not just the chocolate-coated varieties.

Now, to mentally prep for a phone conversation with a recruiter. And do some electronics work.

foodmoved from livejournal

8 Conductor Stranded Cable

Would any of you happen to have any eight-conductor stranded cable, preferably shielded?

I need to make some cables for part of the Honda Music Link stuff I’m working on, and I’m having difficulty finding this sort of cable in quantities less than 500′ or 1000′ rolls. I only need maybe… 20′ or so, at most. Even 10′ would be usable for my prototype stuffs.

Thanks!

electronicsmaking thingsmoved from livejournal

Groundhog in Elizabeth Park

Groundhog!Groundhog in Elizabeth Park (Trenton, MI)
(Click for more…)

On the way home from Ohio yesterday I stopped off at Elizabeth Park in Trenton, MI to meet up with Danielle. She had procured a My Little Pony kite and was wanting to get out of the house and fly it. Well, after some kite flying we were getting cold, so we started to walk over towards the water.

As we got closer to the river we noticed a groundhog near the sidewalk. As I walked closer to the groundhog I knelt / sat on the ground, and the groundhog kept getting closer, and closer, and closer, seemingly wanting some food. Well, Danielle ran back to her car and grabbed a small packet of Cheetos Flamin’ Hot Crunchy snacks that she had in the car.

Sure, these aren’t the best thing to be feeding a groundhog, but it can’t be anything worse than what the groundhog would forage out of the garbage cans and from beneath picnic tables in the park. The groundhog happily ate the Cheetos, taking them from our hands and wrapping it’s little paw(s) around them, eating them one at a time, sometimes standing up right next to us.

At one point the groundhog was so close that the only way I could get a photo of it. The photo above was at 24mm, with the camera sitting on my knee and the groundhog about 1.5′ (or maybe less) from the end of the lens hood.

Eventually we were getting a bit cold, so after letting the groundhog nose around in the bag a bit, we decided to give it the rest of the Cheetos. Unfortunately, the seagulls in the park were being a bit of a bother, so the remains of the bag (but not the bag itself) were instead deposited deep into one of the openings to the groundhog’s burrow. Hopefully the seagulls weren’t able to get the bits there.

More information on Marmota monax, (groundhog / woodchuck) is available from this U of M site or this Wikipedia article. All of the uploaded photos from time in Elizabeth Park yesterday can be found here (photo gallery retired).

moved from livejournaloutdoors

Silly iPod Remote

If things go as I hope, the following will take an iPod with it’s serial RX line connected to RB0 and skip it forward one track when the tactile switch RA0 on my dev board is pressed:

program ipod_next_track_test

dim buttonstate as byte

Soft_Uart_Init(PORTB, 1, 0, 9600, 0)

main:
while true
  if Button(PORTA, 0, 1, 1) then
    buttonstate = 255
  end if
  if buttonstate and Button(PORTA, 0, 1, 0) then
    Soft_Uart_Write(0xFF 0x55 0x03 0x02 0x00 0x08 0xF3)
    buttonstate = 0
  end if
wend

I just have to make an appropriate cable and I can test it. (The one I had made broke.)

Now, if that works I can get to work on making the EUSART on the chip respond to the Honda Music Link with enough intelligence to make it think that an iPod is present.

Then, if that works I can get to work on making some of the commands received from the HML act as the aforementioned button press, and I’ll have negated the function crappyness of the HML.

After that point I can make up a cheesy little PCB for the circuit and a PIC16F688 (the smallest PIC I could find with an EUSART) to sit permanently in the car. It shouldn’t need much more than the PIC, a crystal (because I’m not sure the mikroElektonika stuff can set the frequency on the internal oscillator), either a LM78L05 or small switching regulator, headers for the DIN connector cables, and a couple of caps. If I’m bored enough I might even make it my first SMT board.

automotiveelectronicsmaking thingsmoved from livejournal

TV Stand Ideas

So, I purchased an LCD TV earlier today via Costco’s website. (This one, if you are curious.)

Well, I need a stand for it. I think I’m going to make one, using a spare part from my desk. Due to a somewhat complicated story I have a spare right hand side desk surface from this shelf. I think I’m going to use it to make the LCD TV stand, but I’m not certain how to make the base.

First off, I think I want the base to be around 20″ off of the ground, so there should be room for a shelf in the middle. I’m thinking I’ll make the base out of black iron pipe, with a shelf supported with tees in the center. The shelf will probably be a random piece of melamine-covered stuffs from Home Depot / Lowes, fastened to the black iron pipe with some manner of pipe clamp.

Or, I could use multiple sets of flanges between some large, flat boards.

I was also thinking of large round PVC uprights, notched, with the shelves set into that.

Hmm. Any better ideas?

acquired thingsmaking thingsmoved from livejournal

Basement Cleaning

Clean, more-empty basement.

Looking towards my workbench in the clean, more-empty basement.
(Click for more photos…)

Well, after dragging my feet on it for a while, I finally finished up cleaning my basement this evening. I still have a pile of things to take to Salvation Army (hopefully tomorrow) and a whole bunch of bottles to get rid of. Anyone who wants to return them to Red Wagon — where they will all be accepted — is welcome to have them all, and any deposit obtained from returning them. I just don’t feel like it. There is probably $20 worth, too.

While I know it won’t sound as good as it could, I also hung the rear speakers from the ceiling in the basement, getting them off of stands, wires out of the way, and generally making things look nicer.

As can be seen here I also did away with the very large green ping pong-like table thing, and turned what was the rack of computers into a shelf for things. This shelf wasn’t needed as I spent a good bit of time earlier in the year condensing many of my computing things on to my desktop, saving power, cutting down on maintenance, etc.

So, all in all this is a good thing. Hopefully I’ll get to cleaning the bathroom(s), kitchen, and doing a general dusting and vacuuming sometime this holiday weekend.

around the housemoved from livejournal