21 Mar 2006 The Swirling Brain   » (Master)

Well, Bethany's been in the hospital for about a week now. Her PFTs had dropped to 67% and they wanted to get them up. So she's getting a tune up! She's doing Ventolin, Tobi (aerosol tobramyicin), Dnase, Intraveneous Antibiotic (probably Tobramyicin). Basically, all the stuff we do at home in a more concentrated form plus all the intraveneous stuff. Teresa's taken off of work to stay at the hospital with her. That's killing us! Any extra I made with the ball trails this week is getting eaten up by Teresa staying off of work. :-( The latest is that Bethany dropped below 65% so what we thought would be news of her leaving the hospital today is met with news that she's worse than when she came in! Ugg. So now we don't know when she's going to get out. The doc is so funny, he said, "She should be out of here by Christmas!" Yeah, like that's so funny! We got two for the price of one: A doctor and a comedian! Woohoo! Bethany's been living up. She gets to eat all she wants - they just bring it to her in bed! She's been getting presents and candy left and right! People call her and talk to her for long periods of time. She gets all the sympathy she has ever desired! All that and she doesn't have to go to school! She did spend her spring break at the hospital, but at least she didn't miss that week of school.

Me, we'll I'm wasting time when I should be making RBSs doing PIC16F877A programming. Why 16F877a? Well I bought a couple of 877a eval boards that I want to use as the brain for a granfather clock RBS. The boards have everything I want like a RTClock, Display, keypad, & pic cpu. The boards even have a ZIF socket for the PIC chip for "crash & burn" type development! Or you can use the serial port on it with the pic bootloader preprogrammed into it. It needs to have more I/O for all the junk I want to add on it especially a couple of steppers to drive the clock hands. I figured I would just use an 16F84 via some comm line (probably i2c) to drive a couple of steppers. I want to use i2c because it's already being used by the clock chip and the eeprom on the eval board. I figure I can just tap into the lines so I don't have to use any more i/o for comm to another chip. Also, I wanted to get my hands dirty on i2c to see how I like it. The 877 has i2c onboard. the F84 it'll have to be a software emulation of it but I think it will fly.

So, I dusted off my scheduler code and got it tested in the debugger. Found a few bugs and squashed them. Upped the number of tasks to 10 and moved the schedular and my interrupt service routine variables up into bank 3. Dealing with the banking issues RP0 & RP1. Also had to do it for IPR since I was using FSR and INDF variables. Got that all working again. So now my code and variables have room in the other banks.

One thing I ran into with the 16f877a was the PCL (Program Counter) being only 8 bits. I don't remember it being that bad on the 16F84 but perhaps I just didn't pay attention. So what happens is if you want to do a table lookup, you have to set this other register called PCLATH with the high byte of whatever label you want to jump to then modify your PCL to do the table jump. So the PCLATH is the HIGH byte, the PCL is the LOW byte, and viola, you have a long relative jump where you can programmatically go anywhere you want! So the 16f877 has 8k of program memory in four 2k pages. That means that eventually your goto and call functions won't work either as they only address 2k? of code space. So again, you have to load some of the bits of the PCLATH first with the high byte of your label address to do a long jump or a long call. Since it starts getting confusing as to when you should or shouldn't load the PCLATH, it gets to where you just do it all the time now to make sure you aren't missing something. Or, perhaps your program expands and if you didn't do one before your program just mysteriously quits working, so you better do it now or you'll mess up later. It would be nice if there was some kind of macro that would figure it out but I guess that would be confusing too. So, there iS Assembler page pseudo thingys you can insert into your code. I haven't researched them enough yet but for now I haven't used them. Anyway, that's the weirdness I found with the 16f877. It's not a show stopper, but I sure don't think PIC programming is as easy anymore as I used to. I guess other CPUs have code pages too. I just thought that was a thing of the past. Really makes you appreciate 16 bit processors as opposed to 8bit. With 8 bit processors you're always dealing with math issues and addressing issues. Just move up to 16 bit and they all go away. Well some of them do anyway. PICs should be 16 bit I tell ya! Imagine the poor souls who had to deal with 4 bit processors way back when! Yikes!

I tried to look into using some freeware version of PIC C language. The problem I ran into was they would have support for rs232 but not for i2c. I need i2c for my real time clock, eeprom, and stepper controller chip (that I have yet to make). There was some other things that were missing or seemed to be a problem, like a huge RTOS which would suck away a lot of my resources, limited freeware stuff (like the freeware version is limited to 2k of your 8k available and the pro version is like $250 or more), there were other things I ran into also, which at the moment are not coming to mind but ended up being a show stopper for programming in C on a pic. :-( I was really wanting to do that eventually. I guess it all takes lots of money which I'm not willing to let go of right now.

Also, I ran into problems with the Linker. I have a bunch of relocatable "code" and "udata" pages. For some reason I couldn't get the linker to accept them and just pack them in right. Like I haven't broken 2k yet so you'd think it would just stuff them all in the first page. I got the sample template for the 877a and added my files to it. I just about thought I had it working but I kept getting some weird error when the linker finished. So my remedy was just to put all the code and data back into one big file and assemble it. Like no real linking happens so it just builds the hex file. Stupid linker! What a big waste of time. There again, linkers should be easier! No telling how many times, even on really big projects, the CMT guys always had trouble with linking stuff the right way. Like building the perfect automatic linker is a field that's ripe for picking. Yeah, yeah, I know it's more complex than that but really, why does it have to be so complex? Like standardize linker coding into some easy "basic" like linker language so you don't have to learn a zillion linker weird structure info languages. I guess it's from severe lack of being or even wanting to be a Config Managment guy. I mean is it so much to ask that I should just be able to write a program, and the thing just automatically builds the right way without me having to tell it a bunch of junk it should already know of should be able to figure out on its own?

I'm about 20% done with the RBSs that I've been contracted to do. I'm a little behind work on them. Partly because of having to travel down to Children's Medical center so much this last week and partly because I get distracted easily. I'll build on a sculpture for a while and it'll get hot. So I'll walk away from it to let it cool. I get busy doing something else, then it's hard to get back to working on the sculpture.

I believe my life is a type of roller coaster. I know that's so profound. I'll go though periods of being bored. So I'll find things to do and start filling up the bordom. Just about the time I get happy with the fact that I'm not board and I've occupied my time with something, that's when a bunch of things will arrive that I "have" to do. SO, all the things I want to do which I've spent time and money gearing up for, have to be put on the back burner to do the things I have to do. Part of me tries to keep doing the things I want even though I really don't have time for them any more. So then the things I want get dropped altogher and some of them get lost (or rather what I like to say, "got cleaned out of existance" - a term borrowed from Eric Yundt). So then the "have-tos" start going away, and my want stuff disappeared, I get bored again and the cycle repeats.

Latest blog entries     Older blog entries

X
Share this page