Wednesday, August 29, 2007

Xcode now is installed!

I now successfuly installed Xcode. The reason it couldn't be installed before was because the folder /Developer was there. After deleting this folder and redo the installation, it went thru successfuly.

Friday, August 24, 2007

I am a Mac Convert!

Since the very early stage of my computer learning (which might be more than 20 years ago), I never used or even learned to use Apple products (Macintosh etc.). I have been a devoted PC user wholeheartedly.

I had been thinking to get another laptop which is light, easy to carry, beauty in the look, robust, quite fast and surely is in the trend. I looked at HP, Sony, Lenovo, or Toshiba laptop, even Acer tablet PC but nothing to interest me. All of them run Micro$oft Vista (which I hate, mostly because of its resource hungry). Besides, I wanted to explore to other sides of the "dark side". Linux is another one, but then it has been my toy for years now.

Last week (Aug 14), I was curious about Apple's product and went to its site. I saw they were having a deal: buy one MacBook get one iPod nano for free (or with additional $50 to upgrade to iPod Video). Not bad, I said. The deal was especially for students.

One interesting pricing scheme is that the black color is about $70 more expensive. I don't know exactly what reason for the difference, but I didn't care because I like the white color better (it's so unique and slick, no PCs made with this color and style).

I opted to add an extra 1 GB of RAM (the standard one came with 1 GB). I also chose the 120 GB HD version, plus I ordered mini-DVI to DVI (to be able to hook it up to standard LCD screen). It came with apple remote (looks so cool), 2 MacOS+iLife Installation DVD. I also bought iWork '08 (Supposedly the Office competitor in Mac world). The Micro$oft Word 2004 was installed but it was actually a trial and I didn't want to waste couple hundreds of dollars for M$ product.

When the package came (the macBook was shipped from Shanghai, but took only 4 days to deliver), I saw the box was relatively thinner than average PC boxes (I took some pictures of it, but did not have a chance to uload them here yet). The manual is just a small booklet, but the rest of information is in the HD (PDF file). No big deal to me. Oh.., I love the power supply. It's soo cool and small, yet it can provide juice about 60 W. The connector to macBook is also a smart masterpiece made by Apple. Instead of snapping with lock, it uses magnetic and can be connected in both sides (no need to know the polarity). What a design!

After opening the box, I tried to weight the laptop. It's weight it is about average like other subnotebook (13' screen laptops). No caddy or tray to put CD/DVD. They just need to be inserted to the hole on the side. Keys on the keyboard is slightly different than PC keyboards. Most noticeable one is the apple key. It also has "FN", "CTRL", "ALT/OPTION" and CD-eject keys. There are two different ENTER keys (not sure what is the function for the extra one). There is only one button below the touchpad. The keys are made quite shallow but yet are comfortable to press. Barely hear the 'click' sound there.

One tiny web camera is on the top of the screen along with a tiny LED and microphone. There are two USB2 ports and 1 FireWire 400 Mbps port. The Audio in/out are very good as they are combos with optical audio in/out. 1 Gigabit Ethernet is also there. All these ports are located on the left side of the laptop (the right side is for CD only).

The Wireless network supports A/B/G/N standards, so it can go up to 100 Mbps (theoretically). The DVD is capable of reading/writing dual-layer +/-R and onto WR as well. There are two tiny speakers hidden close to the LCD hinge (guess they don't have enough power to make 'boom' sound).

One thing I am really not used to is the font. Unlike Windows fonts which are very sharp, Mac OS's fonts are kind of blurry. I read some article about it and it says that is because Apple has been following different path of how to draw fonts (font rendering). The main difference is fonts on Mac are more closer to what they suppose to be drawn on screen and printer.

Software sides, this is what Mac away excels than Micro$soft. From widgets, animated windows, zoomed toolbar, high DPI icons, etc. Mac Is undoubtedly the winner here. It also does not eat that much resources compared to Windows, especially Vista. I barely notice any slowdown on performance, while my office laptop (Dell Latitude D620 with 2 GB and Nvidia's dedicated graphic card) has been somewhat slower than when the first time I used it due to many softwares installed. No wonder, Apple is based on Unix (FreeBSD) which is known for its efficieny, stability and robustness. I also noticed the used space is comparably less than on NTFS, although MacOS uses Journaled HFS+ (see, they have been using journaling system long before Windows. Even current Vista doesn't have this journaling as they originally promised to include into WinFS). Imagine, my 120 GB (about 112 GB for the actual usable space) still has about 94 GB left, eventhough I'd installed many softwares (MS Office trial, iWork '08, Mac's Xcode IDE, many bells and whistle gadgets and tools I downloaded from the Internet).

Other softwares are so integrated and work flawlessly and smoothly. Most notable are iTune and iPhotos. GarageBand is also a very good one to try. It has virtual instruments that playable thru keyboard (and are polyphonic!) I did download some freewares there too, including Google Earth, Skype and Adium (for chatting. It recognizes most protocols including GoogleTak, Y!M, AOL, Gadu-gadu etc.)

The sleep mode is very stable and fast. We either just need to close the lid, press the power button for short time or go to Apple->Sleep. To wake it up, just open the lid or press the power button. Also the lid doesn't have mechanical latch. It uses magnetic and snap to the body. Full standing ovation to Apple for this.

Pricewise, this is not an expensive laptop as some people might think. $1099 is the standard price. But it comes with many extra and elegant stuff which can only be found on a few high-end laptops (such Sony VAIO, Toshiba or Lenovo).

I am, though, still unable to install Xcode + development tools to this one. I don't know why. But I will explore and google more to find out the reason.

The bottom line is, I am falling in love with my new MacBook. Probably I won't go back to Windows (unless I are forced to use because of some software or for work-related stuff). For other hacking stuff, I still use my SUSE Linux (installed both on my dual-processor desktop home-server and old Toshiba laptop).

Here I list the hardware data of my macBook (for security reason, I removed some of the condifential data):

Model Name: Mac
Model Identifier: MacBook2,1
Processor Name: Intel Core 2 Duo
Processor Speed: 2.16 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache (per processor): 4 MB
Memory: 2 GB
Bus Speed: 667 MHz
Boot ROM Version: MB21.00A5.B06
SMC Version: 1.17f0
Sudden Motion Sensor: State: Enabled

ATA Bus:

MATSHITADVD-R UJ-857E:

Capacity: 516.57 MB
Model: MATSHITADVD-R UJ-857E
Revision: ZB0E
Serial Number:
Removable Media: Yes
Detachable Drive: No
BSD Name: disk1
Protocol: ATAPI
Unit Number: 0
Socket Type: Internal
Low Power Polling: Yes
OS9 Drivers: No
S.M.A.R.T. status: Not Supported

Intel High Definition Audio:

Available Devices:
Headphone:
Connection: Combo
Microphone:
Connection: Internal
Speaker:
Connection: Internal
Line In:
Connection: Combo
S/P-DIF Out:
Connection: Combo
S/P-DIF In:
Connection: Combo

Apple Bluetooth Software Version: 1.9.0f8
Hardware Settings:
Muhammad Lutfi’s Computer:
Address: 00-1b-63-5d-5b-ae
Manufacturer: Cambridge Silicon Radio
Firmware Version: 3.1965 (3.1965)
Bluetooth Power: On
Discoverable: Yes
HCI Version: 3 ($3)
HCI Revision: 1965 ($7ad)
LMP Version: 3 ($3)
LMP Subversion: 1965 ($7ad)
Device Type (Major): Computer
Device Type (Complete): Laptop Computer
Composite Class Of Device: 1057036 ($10210c)
Device Class (Major): 1 ($1)
Device Class (Minor): 3 ($3)
Service Class: 129 ($81)
Requires Authentication: No
Services:
Bluetooth File Transfer:
Folder other devices can browse: ~/Public
Requires Authentication: Yes
State: Disabled
Bluetooth File Exchange:
Folder for accepted items: ~/Documents
Requires Authentication: No
When other items are accepted: Ask
When PIM items are accepted: Ask
When receiving items: Prompt for each file
State: Enabled
Devices (Paired, Favorites, etc):
M.Lutfi:
Name: M.Lutfi
Address: 00-12-37-fa-60-85
Type: Palm Sized PDA
Services: Service Discovery, OBEX Object Push, Voice Gateway, Dial-up Networking, Audio Video Remote Control Profile, Voice Gateway
Paired: Yes
Favorite: Yes
Connected: No
Incoming Serial Ports:
Serial Port 1:
Name: Bluetooth-PDA-Sync
RFCOMM Channel: 3
Requires Authentication: No
Outgoing Serial Ports:
Serial Port 1:
Address: 00-12-37-xx-xx-xx
Name: M-1
RFCOMM Channel: 4
Requires Authentication: No
Serial Port 2:
Address: 00-12-37-xx-xx-xx
Name: Bluetooth-Modem
RFCOMM Channel: 4
Requires Authentication: No

MATSHITA DVD-R UJ-857E:

Firmware Revision: ZB0E
Interconnect: ATAPI
Burn Support: Yes (Apple Shipped/Supported)
Cache: 2048 KB
Reads DVD: Yes
CD-Write: -R, -RW
DVD-Write: -R, -R DL, -RW, +R, +RW, +R DL
Burn Underrun Protection CD: Yes
Burn Underrun Protection DVD: Yes
Write Strategies: CD-TAO, CD-SAO, DVD-DAO
Media:
Media Type: CD-ROM
Blank: No
Erasable: No
Overwritable: No
Appendable: No

FireWire Bus:

Maximum Speed: Up to 400 Mb/sec

Intel GMA 950:

Chipset Model: GMA 950
Type: Display
Bus: Built-In
VRAM (Total): 64 MB of shared system memory
Vendor: Intel (0x8086)
Device ID: 0x27a2
Revision ID: 0x0003
Displays:
Color LCD:
Display Type: LCD
Resolution: 1280 x 800
Depth: 32-bit Color
Built-In: Yes
Core Image: Supported
Main Display: Yes
Mirror: Off
Online: Yes
Quartz Extreme: Supported
Display:
Status: No display connected

BANK 0/DIMM0:

Size: 1 GB
Type: DDR2 SDRAM
Speed: 667 MHz
Status: OK

System Power Settings:

AC Power:
System Sleep Timer (Minutes): 10
Disk Sleep Timer (Minutes): 10
Display Sleep Timer (Minutes): 10
Automatic Restart On Power Loss: No
Wake On AC Change: No
Wake On Clamshell Open: Yes
Wake On LAN: Yes
Display Sleep Uses Dim: Yes
Battery Power:
System Sleep Timer (Minutes): 5
Disk Sleep Timer (Minutes): 10
Display Sleep Timer (Minutes): 1
Wake On AC Change: No
Wake On Clamshell Open: Yes
Display Sleep Uses Dim: Yes
Reduce Brightness: Yes

Battery Information:

Battery Installed: Yes
First low level warning: No
Full Charge Capacity (mAh): 5002
Remaining Capacity (mAh): 5002
Amperage (mA): 263
Voltage (mV): 12632
Cycle Count: 2

AC Charger Information:

Connected: Yes
Charging: Yes

Hardware Configuration:

UPS Installed: No

Intel ICH7-M AHCI:

Vendor: Intel
Product: ICH7-M AHCI
Speed: 1.5 Gigabit
Description: AHCI Version 1.10 Supported

ST9120822AS:

Capacity: 111.79 GB
Model: ST9120822AS
Revision: 3.CAE
Serial Number: 5RM09N7A
Native Command Queuing: Yes
Queue Depth: 32
Removable Media: No
Detachable Drive: No
BSD Name: disk0
OS9 Drivers: No
S.M.A.R.T. status: Verified
Volumes:
Macintosh HD:
Capacity: 111.47 GB
Available: 94.33 GB
Writable: Yes
File System: Journaled HFS+
BSD Name: disk0s2
Mount Point: /

USB Bus:

Host Controller Location: Built In USB
Host Controller Driver: AppleUSBUHCI
PCI Device ID: 0x27c9
PCI Revision ID: 0x0002
PCI Vendor ID: 0x8086
Bus Number: 0x3d

AirPort Card Information:

Wireless Card Type: AirPort Extreme (0x168C, 0x87)
Wireless Card Locale: USA
Wireless Card Firmware Version: 1.1.9.3
Current Wireless Network: XXXXXXX
Wireless Channel: 6


Software
--------
AirPort Card Information:

Wireless Card Type: AirPort Extreme (0x168C, 0x87)
Wireless Card Locale: USA
Wireless Card Firmware Version: 1.1.9.3
Current Wireless Network: XXXXXXX
Wireless Channel: 6

I will post more for the progress and tricks/info I'll have learnt.

Wednesday, July 25, 2007

Speed Test part 2

Here is a speed test result at my office:

My Next-gen Phone Feature Wish List

Here I list features should be added to next generation phone:
  • Very good quality voice (it is still a phone, right?)
  • Very high speed data access (1 Mbps or more)
  • Very low latency data transmission. The low latency is supposedly to be used for VoIP (Skype-like thing wirelessly) and also for video streaming.
  • A web browser software with full support of flash, javascripts etc.
  • Software to read e-book/documents.
  • Able to play high quality music and support for OGG/Vorbis, besides MP3 (and get rid of the DRM. I super hate it!)
  • Video conference. with 25 fps rate (resolution is not important, but I don't want to see sluggish pictures or to many dropped frames either)
  • Power efficient.

Active Collision Avoidance System

Avionics is not something new today, but autonics (automotive electronics) is still an emerging technology. Although most cars made today use some kind of electronics/microcontroller, either for fuel injection, climate control system or others, the use of microcontroller still more to 'behind the scene' kind of application.

Some newer cars have limited passive collision-warning system. For example, Toyota Sienna XLE Limited. It has 8 infrared sensors, 4 are on the bumper at the front and another 4 at the back. Alarm will sound and warn the driver when distance is too close to the car (like this feature). Some others even add back up camera to see what is in the back through a LCD screen on the dashboard.

Passive collision-warning safety systems seek to reduce the risk of a collision by warning the driver of an impending risk so that he or she can take action to avoid the hazard.

There are many systems which provide warnings to the driver. The first warning systems available on production vehicles were typically "parking assist" type systems, which provide an audible tone when parallel parking and approaching a stationary object such as another vehicle or wall. Such systems have also been implemented in school buses, to detect crossing children who may be out of the driver's view. Today there are much more sophisticated systems which use radar and warn occupants of potential impending collisions under normal driving conditions. A passive collision-warning system is shown. As this diagram illustrates, a visual and/or audible warning is signaled to the driver, but there is no active intervention by the system to avoid a collision.

Image from book

Active safety systems take the collision-avoidance philosophy a stage further by interacting with the powertrain, braking, and even the steering systems. Every manufacturer appears to have a slightly different approach, but the common goal is to sense objects which present a collision risk with the host vehicle, then take preventive measures to avoid an accident. An active collision-avoidance system is shown below. The active system diagram shows that action without the immediate control of the driver is taken in order to avoid a potential collision.

Image from book

Advanced active collision systems use many clever techniques, over and above object detection, to ensure that a collision-avoidance event is facilitated safely and efficiently. For example, a sensor on the windshield can be used to detect the presence of rain and thus a potentially slippery road surface. In this case, the braking distance would probably be increased, so the hazardous object would have to be detected sooner. Likewise, tire-pressure sensors may be used to report the inflation level of tires, which could also have an effect on stopping distance.

It should be noted that although both the passive (collision-warning) and active (collision-avoidance) systems require object detection, there are differences in how the object detection system is implemented. The object detection performance of a collision-avoidance system must be higher and more robust than object detection for a passive system. It is unacceptable to execute an emergency braking maneuver under false-alarm circumstances. False alarms, while irritating for the driver, are generally considered more acceptable in collision-warning systems. Although the passive systems may allow false alarms more often, a more timely response by the sensor is required, as the reaction time of the driver must be taken into account in the event of an avoidance maneuver.


Sunday, July 15, 2007

Most Common and Generic PIC uC

The following is the best choice of PIC microcontroller for general purpose applications.
First, my criteria is a uC that is flash-based, cost-efficient, enough program space (>= 3 kB), has EEPROM, has I2C and SPI interface, programmable thru my PicKit2 programmer, has enough I/O pin (>= 8 I/O), has WDT, TTL-level voltage, low power usage, and able to communicate via asynchrononous serial port to PC. One of the most important thing is the PDIP availability, so I can develop it on my breadboard.

The intention of my future project is to develop home automation. The uC should be able to interface to sensors (thermal, humidity) as well as on-off microswitches (open-close sensors). It shall be able to communicate to my Linux PC via serial port, able to display status via 4x16 LCD display (Hitachi compatible) and still have some extra pins to do extra stuff (probably reading keypad, interfacing to darlington chip or LEDs).

Searched on MicroChip website (www.microchipdirect.com), I got this:


Chip: PIC16F690
Status = In Production
Volume Pricing = $1.20
Architecture = 8-bit (Harvard Architecture)
Program Memory = Standard
Type = Flash
KBytes = 7
KWords = 4
Self-write = NO
Data EEPROM = 256 bytes
RAM = 256 bytes
I/O = 18
ADC Channels = 12
ADC Bit = 10-Bit
ADC Sample Rate (ksps) = N/A
Comparators = 2
Timers/WDT = 2-8bit 1-16bit Yes
HW RTCC = No
Interface = EUSART, I²C Compatible/SPI
Max. Speed MHz = 20
Int Oscillator (MHz) = 8
ICSP™ = Yes
BOR = BOR
LVD = NONE
ICD - # of Breakpoints = 1
CCP / ECCP = 0/1
PWM Channels = 4
PWM bits = 10
Parallel Port = No
Nanowatt = Yes
Vdd Min. = 2.2 V
Vdd Max. = 5.5 V
Pin Count = 20
Packages = 20/SSOP 208mil, 20/PDIP, 20/QFN, 20/SOIC 300mil

The unit price (PDIP only):

Part Number: PIC16F690-E/P
Lead Count: 20
Package Type: PDIP
Temp Range: -40C to +125C
Packing Media: Tube

Pricing:(USD)
1-25
2.00
26-99
1.95
100-999
1.90
1000-4999
1.75 *
5000-9999
1.67 *
10000+
1.59 *


Availability:
200
Order Quantity:







Part Number: PIC16F690-I/P PIC16F690 view datasheet

Lead Count: 20
Package Type: PDIP
Temp Range: -40C to +85C
Packing Media: Tube

Pricing:(USD)
1-25
1.85
26-99
1.80
100-999
1.76
1000-4999
1.62 *
5000-9999
1.54 *
10000+
1.47 *


Note:
The "E/P" in part-number is to tell it is "Extended operational themperature" (Industrial standard). This might fit to auto-mobile applications, where operational voltage is more extreme than home application.