My first acupuncture session

Monday, October 24th, 2005

I heard about the Swiss Institute College of Health Sciences from someone that I had sold my old Wacom tablet to. She was studying massage therapy there. Later a friend’s wife told me about their clinics. Students (ones who are in there last year of study) treat patients over the course of the semester. They, with the help of their teacher, perform a diagnosis and prescribe a set of treatments. She informed me that the massage clinic is always full and that the acupuncture clinic will usually have openings.
So finally, I did the necessary research (aka Google) to see what this school and their clinics was all about. I called up the school during work hours and was greeted by Bernadette. She informed me that there is 2pm Thursday slot open and that she can sign me up for that slot if I wanted to. I was excited that there was an opening and I told her that I would be over shortly. Work was about 15 minutes away, so I quickly pu on my jacket and headed toward the Institute. On the way, I had second thoughts about this slot, because it was during work hours. When I arrived there, I told her that I would prefer an evening slot and she told me to show up on Monday for an appointment. She couldn’t guarantee that I can have that slot, but at least the upcoming Monday was available for one treatment.

So, with a little apprehension(because a student was going to stick needles into my body), I showed up at the clinic yesterday evening.
So when I got there, Bernadette (the receptionist) informed me that I can actually have this Monday slot until the end of the semester and that it would cost $160 for the 7 sessions. I stepped out, got the cash, came back upstairs, andBoris was waiting for me.
He led me into an examination room with lots of curtained off sections. Each was a semi-private area for a student to work with his patient. Boris started by asking me these 10 questions. He also examined the top and bottom of my tongue. I told him that I had some, what I think, are muscular issues with my upper back and neck so he examined those areas a bit. He stepped out for a few minutes to consult with his teacher to recommend a course of treatment. In the adjacent examination area I can hear loud snoring. I assume that the person is currently undergoing treatment and has fallen asleep on their back or stomach. (I also thought that it would be funny if it were an overworked student catching a quick nap!)

Boris returned after what seemed like an eternity, and said that we’re going to do some acuncture and cupping treatments today. He put a piece of cover paper on the face rest, I took off my shirt, and I laid face down on the table. I asked him why the needles will help my condition. He says that part of the the muscle issues and the sore neck could be from the Qui becoming stagnant. So the needles would help move the Qui in that area. He then proceeded to put couple of needles on the right side of my neck and then the left side of my neck. With each needle, I think he pinched my skin a bit, gently inserted the needle at the surface and then tapped the head of the needle to reach the rigth depth. He then felt along the muscles of my left upper back, sensed tight spots, ask for my confirmation, and then he inserted needles into these areas too. In total, I had about 10 needles on my back. I thought we were done, but he said there was one more needle left. He put this one at the first joint near the tip of pinkie of my left hand. He warned me that this one would hurt a bit. It actually didn’t hurt that much but it did feel like a pin prick. He stepped out of the room and left me there for about 5 to 10 minutes.

I definitely felt something. It seemed like maybe there was more blood circulating to the areas. It could have been all mental. I also wasn’t use to lying on that kind of table, with my face in this cushioned donut. I felt my arms, which were by my side, tingle a bit, but it could have been because of lack of circulation. :) Anyhow, he came back after some time removed the needles and told me that it was time for cupping. He put some kind of ointment on his hands and rubbed it around my upperback. Then I saw a flickering light cast onto the curtains; it was obvious it was from a flame. He didn’t give me any warning, and I felt that he was rubbing something, something that felt like a blunt rubber object up my back and onto my trapezius muscles. He traced this path back and forth a couple of times and near the end it felt like he was exerting increasingly more downward force as he was rubbing. Then I heard a pop! He had been moving the cup around the surface of my body. I had envisioned that cupping was a static treatment. I’ve seen pictures of people lying there with transparent cups on their back. I just assumed that that was all there is to cupping. Boris warned me that there will be markings on my back…and here’s what my back looked like last night.

Full View  Side View

Close Up

After that he said “See you next week.” I put got dressed and headed out into the rainiest NYC week in history. On the way home, I think I felt more relaxed and maybe the muscles had loosened up a bit.

New Camping Gear

Friday, October 21st, 2005

I was down in Soho today and dropped by EMS to see if they had any new gear/gadgets. One of the salespersons, John, showed me these Orikaso fold flat serving vessels! I bought one of each…a cup, a bowl and a multi-configuration dish.

I proudly display them here.  :)

The cool thing about these is that they pack flat! So they’re great for camping. They’re also really cheap. The plate was $6, the bowl was $3 and the cup was $4.

PIC Timer Interrupts

Friday, October 14th, 2005

Here’s a very basic program to use TMR0 and an interrupt for TMR0 to do something every second.
I’m using a 4Mhz clock.

We are setting up the PIC so that everytime TMR0 reaches it’s max value(this is configurable), a Timer Interrupt occurs.

----------------------------------------------------------------------------------------

'Works w/ 18Fxx2 - James Tu 06/01/2004

'This program sets up a TMR0 interrupt
'The interrupt happens every 1 sec!
'I timed it...it's pretty precise

'It changes the state of an LED every second.

led var PORTB.4
ledstate VAR BIT

ledstate = 1

INTCON2.7 = 0 'Enable PORTB pullups...18Fxx2

'setup TIMER0
'set the high and low bytes of TMR0...
'we'll be using it in 16-bit mode
'This is equal to 65535 - 62500 = 3035...
'Calculated to give us 1 sec interrupts with 1:16 prescalar
TMR0H = $0B
TMR0L = $DB

'Enables TMR0, set to 16-bit
'Enable Pre-scalar
'Set prescalar value 1:16
T0CON = %10000011

On Interrupt Goto myint ' Define interrupt handler
'Enable Timer0 Interrupt
'Turn on INTCON.7(GIE) and INTCON.5 (TMR0IE)
INTCON = %10100000

TRISB.4 = 0

loop:

led = ledstate

Goto loop ' Do it forever

' Interrupt Service Routine
Disable ' No interrupts past this point
myint:
if ledstate == 1 THEN
ledstate = 0
ELSE
ledstate = 1
ENDIF
INTCON.2 = 0 ' Clear TMR0 interrupt flag
TMR0H = $0B ' put 3035 in TMR0 for 1 sec interrupts
TMR0L = $DB
Resume ' Return to main program
Enable

----------------------------------------------------------------------------------------

Instead of changing the state of the LED, you can increment a variable…If have you have a variable called
SECONDS, you can add 1 to SECONDS when this timer interrupt occurs. This will allow you to keep time…for time event driven processing.

TMR0 can hold a 16-bit value or an 8-bit value
TMR0 has a pre-scalar that can be set to either 2,4,8,16,32,64,128, or 256.
(What the pre-scalar do is that it slows down the counting of TMR0. If the pre-scalar is set to 32, TMR0 increments by 1 every 32 PIC clock “ticks”)

Here’s the math…

  • 4Mhz crystal means an internal clock of 1Mhz
  • 1Mhz means there’s an internal clock “tick” every .000001 sec.
  • TMR0 can hold either a 16-bit(65536) or an 8-bit(256) value…I chose 16 (therefore TMR0 can count from 0 to 65535)
  • If we just left it like this, TMR0 counts from 0 to 65535 and the TMR0 Interrupt will happen every 0.065536 sec (65536 * 0.000001) .
  • We want TMR0 to interrupt every 1 sec.
  • If we set the pre-scalar to 16, TMR0 will interrupt every…0.065536 * 16 = 1.048576 sec…pretty close to 1 sec.
    • If you want you can leave it at this. If you want really precise timing, you have to do the following…you have to fill TMR0 with a starting value.(TMR0 is just a register so you can set it to any value.)
    • We want the solution to the equation:
      • value * 0.000001 * pre-scalar = 1.0 sec
      • value = 1.0/(0.000001 * 16) = 62500
    • So we want TMR0 to count 62500 not 65536. What we can do is to set TMR0 to 65535-62500 = 3035. So it actually counts from 3035 to 65535 which is 62500! We do this at the beginning of the program and every time an interrupt happens.
    • TMR0 is a 16-bit register in my example, so we have to write two bytes…one is written to TMR0H (high byte) and TMR0L (low byte).

That’s it!

The table below shows the interrupt intervals you can expect from a 4Mhz clock, and a 16-bit TMR0.

prescalar 2 4 8 16 32 64 128 256
TMR0 INT happens every (sec) 0.131 0.262 0.524 1.05 2.09 4.19 8.38 16.77

“Open-collector”, “Open-drain” demystified

Friday, October 14th, 2005

You’ll come across the terms “open-collector” and “open-drain.” These are used sometimes to describe how a particular IC’s pins are implemented internally.

This and also this are good explanations of what those terms actually mean and why an IC’s pin would be designed as open-collector or open-drain.

Max232A RS-232 Driver/Receiver

Friday, October 14th, 2005

Maxim’s RS-232 level converters are sometimes necessary if a chip or a control board needs to communicate with the PC, especially if the specs for the chip/board indicates that it can only accept TTL/CMOS logic levels. The uControllers, the PIC and the BX-24, that we’ve been using are more tolerant of these voltage levels, so that’s why we can connect the TX/RX of the PC directly to these uControllers.

For situations where you need to shift the voltage levels so you can communicate with a PC(on the PC the voltage swings from +12 to -12 V), you’ll need the Max232A. This bumps up the voltage for serial communication TO the PC(because most chips/boards work on 0 to 5 volts) and lowers the voltage for serial communciations FROM the PC to a safer level for the chips/boards.)

If you are using the MAX232A, you’ll need five 0.1 uF capacitors. The datasheet has a connection diagram that shows 5 polarized capacitors. You can use non-polarized caps. I verified this with MAXIM technical support.

PIC IR remote

Friday, October 14th, 2005

Here’s the info on how to control a SONY TV. (caveat you may need to do some debugging.)

You need a 555 timer to generate the 40 Khz for you.
Your pic just turns on or off the 555 to transmit the appropriate data.

Circuit link.

SIRC codes explained.

SIRC code data format

My PICBasicPro code to implement this protocol.

Update:

Found a simpler solution. Use this IC from rentron. It will generate either a 40 or 38KHz carrier frequency for you. Use the PIC program above and connect the PIC pin to DATA IN of this IC. You need a 4Mhz clock, some pullup/down resistors, and the circuit to drive your IR LED…that’s it!

Getting warmed up with WordPress

Wednesday, October 12th, 2005

OK. I’m finally going to start blogging. I’m just going through the initial preparation phases and am configuring the environment. I’m going to try to use the Textile plugin for quick and easy text markup during posting. Textile 2.6b for beautifiers (Textile without the code markup) can then be used with GeshiSyntaxColorer for code markup!

…I’m actually having problems getting the Textile 2.6b plugin to workr with GeSHi. If I turn off Textile 2.6b, GeSHi works fine. Otherwise, instead of nicely formatted/colored code, I see all the HTML tags for the code.

This should be code formatted below

/*
This is a comment block
*/

//this formats and prints the contents of an array
print_r($some_array);

foreach($array as $key=>$value){
print "$key => $value";
}