Harri Sapto WIJAYA

5 January 2009

Bintan and Free Fiscal

Filed under: Uncategorized - Administrator @ 3:29 pm

photo first, story later :D

http://www.flickr.com/photos/24115573@N06/

port at Penyengat island kayak at Nirwana Garden free fiscal

tuguTrikora Beachjetski at Nirwana Garden

- si bolang, si bocah petualang -

19 November 2008

Cold drink make Warm

Filed under: general - Administrator @ 2:29 pm

feel tired at evening/night?

wanna a glass of cold drink but the weather is so cold?

here is the solution: pour a sachet of "Tolak Angin Sido Muncul" into a glass of cold milk, then stir them.

Feel the warm in a glass of cold drink. Must try! emoticon

27 October 2008

Journey to Johor

Filed under: general - Administrator @ 4:11 pm

Almost no plan, we three — myself, flatmate, and officemate — went to Johor Bahru, Malaysia. We thought it’s better than doing nothing at home. So we got the bus 950 from Woodland Regional Interchange, that is the bus from Woodland Singapore to Kotaraya Malaysia. Qeueuing not too long for the bus, but many people also, may be because this is long weekend, tomorrow is monday and holiday for Deepavali –Indian people festival–.

I think no more than 10 minutes, the bus stop, all passenger alight for passport checking in Check Point Authority of Singapore, then continue. Second time and for last time we stop again, now in Check Point Authority of Malaysia, after no more than 5 minutes journey I think. And,, fyuh… so many people there, queueing so messy, so I called BBQ –barbarqueue–. There is a guy sit behind the desk, writing on "white card"; hm,, he is what we call "calo" in Indonesia emoticon, fuh… Malaysia is similar to Indonesia.

Waw, 30 minutes has over, still queueing. I look a couple Singaporean with their friend cut the queue by making new queue. he he.. I follow them. As I predict, somebody will complain, an old man told to me, "where is your queue?", I just said "this, I just follow them". FYI, his wife –i think– just complain to my friend before by saying "Hey you cut queue, shame!". Agh, don’t care, who wrong? emoticon (ngeles) why the security guy don’t take an action. I saw them just stand on front, watching to the messy queue. Fyuh…

Around 1 hour has passed. My queueing was completed. Ah, I can breath free… free? I don’t think so, some disturbing smell outside. Aiyah, teh environtment outside not so good, it seem like the cities in Indonesia, almost no different. We went to food court to fill up our hungry stomach. Because I confuse to choose, I just choose ‘nasi goreng ayam’ and hot milk tea, all are RM 7 –ringgit malay.–. We continue to see some building in Johor, not too many.

near Indian market at Johor 

(image: near Indian market)

Ah, no plan, no guide, so no direction. After go around, shopping a little, we don’t know to where we have to go. No choice, go random! We got a bus to Kota Masai, and just said to bus captain, "ke kota masai", and paid RM 3 and 40 cents. Not like in Singapore, we still pay by cash here. 3 or 4 hour journey until we back to original point emoticon. We don’t where we have to alight, so just waiting for interesting place, and it bring us back to original point. Not bad, we just look the Malaysian people’s life, children play around, mother with her kid gather with another neighbour. I think it’s nice to live here, althought the transport not as good as in S’pore.

Last thing to do, dinner! I choose ’sop daging kambing’, hm,,, nice. But the environment not so good, food booth at Pasar Balubur in Bandung is slighlty better. So, what I got from Johor are physicaly look-like this below. T-shirt, Tolak Angin herbal made in Indonesia, and some of ringgit.

handgift may be 

(image: handgift if you pretend it as handgift)

Then go home. Again, BBQ (affirmation: BarBarQueue). I thought, "whether Malaysian people don’t be shame, here in check point there are people from almost around the world, I saw from their passport: Singapore, Indonesia, Nepal, India, Kazakstan, Korea, United State".

We thought it will be too long and too crowded if using bus, so we use "FOOT", we walking from Malaysia to Singapore. Don’t thinking it’s so hard, only around 20 minutes untill we reach check point of Singapore. Ah, here is more tidy, and no BBQ emoticon. I took bus for 2 stops, then train for 1 stop, then go home.

 

That’s all my long weekend, as I remember :)

12 October 2008

Back to …

Filed under: general - Administrator @ 6:12 am

I unlock the door, going outside for a little shopping. Hmmm… I breath the morning air, last night journey didn’t make me so tired, so so. When I look around, look familiar, but I confuse, what I have to say ? Should I say "I’m home", while I far from home here now. If I didn’t say "I’m home", my live is here, may be my future as well.

Sudden decision. One and half hour before I go from home, my mam said, "it’s better to booking a whole car instead of using public transport, due to your luggages and the wheather look-like not good. Pay more money for more comfort I think it’s fair. More, we can accompany you." So we book a whole car and my mam, my dad, my grand-mam, my old sister, my nephew and my niece, included also :) . They accompany me until Bandung in 3 hour journey. then I take direct shuttle transport to airport for another 3 hour. And 1.5 hour. And 1 hour.

My 2 week more leave it’s feel enough, not too short, not too long. But not so many place I visited during my vacancy. I just go to my grand-pa and grand-ma home (1 home apart :P ), to another family home. I went to mall (for food-court and cinema actually). And the most important is for celebrating Iedul Fitri, time for "self-purging", time for forgiving.
Here is my photo in the one of natural water source, called Cipulus. The place used to play when I was small.
hsw under rubber tree

Now I’m back, from hibernation :) , ready for more…

31 August 2008

First Taraweh

Filed under: general - Administrator @ 4:31 pm

My first taraweh sholat in the country where Moslem are minority.

Because my place is far from mosque, so we (Moslem people in our apartment block) do the Taraweh sholat in the link hall in between apartment. But our Taraweh was done without Khotbah (allaution). Here below the situation after taraweh:
My First Taraweh Sholat

It make me feel at home town…

Marhabaan yaa Ramadhan… (welcome, Ramadhan!)

17 April 2008

Google Search

Filed under: general - Administrator @ 2:00 pm

surf into www.google.com, type "harri sapto wijaya" (including quote!), then you’ll get the result in first page all related to really Harri emoticon

google search for harri 

Have fun go mad! 

-a bit ‘narsis’-

12 April 2008

Cloud

Filed under: general - Administrator @ 1:56 am

Cloud…

When I was a junior high school student, I often lay down in my bedroom and watching to the convoy of clouds in the sky. Subhanalloh, so nice…

http://blog.telephonyonline.com/telephony2/wp-content/uploads/2007/10/cloud.jpg 

Cloud, it let me remember to the favourite tv program when I was elementary student, "Anak Seribu Pulau" (Children from Thousands of Islands) on RCTI, also it’s soundtrack "Negeri di Awan" (Land on Cloud) by Katon Bagaskara.

you play for me
a song about a land on cloud,
where the peace become it’s palace

(translated from Negeri di Awan)

Usually I assume "you" as male, but for this case I assume "you" as female.

 

-once upon a time, there was a child…- 

23 March 2008

I Choose Blogsome Rather Than Wordpress

Filed under: general - Administrator @ 10:34 am

One day, I look around to several of my friends’ blog. Most of them using wordpress, some of them using blogger or friendster blog. I’m interested to WordPress when I found my friend link a pdf file from his WordPress file container, something that can’t done using Blogsome (it only support image file). I’m seduced to migrating from Blogsome to WordPress, and just copy-and-paste the setting in Blogsome to WordPress. But…

I registered already an account in WordPress, and log in, look similar to Blogsome "control panel", but hey… where is the "File" (Blogsome terminology) tab to edit the template? I can’t found it. So I googling with keywords "different between blogsome and wordpress" and link me to this weblog. Although it’s only blog, but the study is objective, here below is some of his (I think he is male) results.

 

WordPress and Blogsome are same 

However, WordPress.com is currently running WordPress 2.0 while Blogsome is running WordPress 1.5. That’s not to say that WordPress.com is better than Blogsome. Just slightly different.

Where Blogsome has it over WordPress 

You can actually edit the templates. WordPress.com won’t allow you to edit the templates at all. This gives Blogsome extra flexibility that you don’t get with WordPress.com.

Where WordPress has it over Blogsome 

WordPress.com offers more themes than Blogsome. Five of them are the same, but the rest are different. WordPress.com’s selections generally have a more professional appearance, but that doesn’t mean a better appearance.

More on Blogsome 

While you can edit templates, adding JavaScript to the HEAD section doesn’t always work. In particular, many functions are disabled and the JavaScript throws an error. If you’re not familiar with JavaScript, it may not matter to you. But do be aware of this limitation. JavaScript in the BODY seems to work just fine. Including Blogrolling.com code, TTLB status code, and the like. It’s only functions in the HEAD that seem to be an issue.

 

After comparing and considering, I chose to stay with my Blogsome, because I want flexibility in using theme. Blogsome show the theme code in HTML and style page in CSS, they are editable! You can see in my blogsome (actually you’ve done), I can add clock, shoutbox, hit counter, ip tracker, create button (instead of link), delete something that I doesn’t likes, almost anything!

How about you? emoticon

[only thing I still not know, how to change password? anybody could help me?] 

-it’s all about choice, you freely to decide which one is suit you- 

22 March 2008

Build Your Own I2C Header File

Filed under: microcontroller, tutorial - Administrator @ 1:08 am

In order to keep my blog useful, I create the microcontroller category. So we* can share our knowledge and experience.emoticon

* : I means, myself and readers

Let’s go.

———-

I learn about I2C protocol when I did my academic project of Embedded System lecture, I built a digital phone book. It only device that capable to store and manage some data, that all. (Apologize I can’t include my device photo, imagine it as a device with keypad, LCD display, and some additional buttons).

 

I²C is a multi-master serial computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, or cellphone. The name stands for Inter-Integrated Circuit and is pronounced I-squared-C and also, incorrectly, I-two-C. As of October 1, 2006, no licensing fees are required to implement the I²C protocol. However, fees are still required in order to obtain I²C slave addresses.[1] SMBus is a subset of I²C that defines stricter electrical and protocol conventions. One purpose of SMBus is to promote robustness and interoperability. Accordingly, modern I²C systems incorporate policies and rules from SMBus, and the line between these two standards is often blurred in practice. (ref.: wiki/I2c)

Hardware 

The I2C bus physically consists of 2 active wires and a ground connection. The active wires, called SDA and SCL, are both bi-directional. SDA is the Serial DAta line, and SCL is the Serial CLock line. Every device hooked up to the bus has its own unique address, no matter whether it is an MCU, LCD driver, memory, or ASIC. Each of these chips can act as a receiver and/or transmitter, depending on the functionality. Obviously, an LCD driver is only a receiver, while a memory or I/O chip can be both transmitter and receiver. (ref.: esacademy.com)

I2C bus [figure 1 I2C bus design]

If you wonder why the default state is in high logic, one of the reasons is to prevent voltage drop due to long wire. If the default state is low logic, when device transmit the high logic bit, it’s no guarantee that it will be kept high logic along wire.

Communication 

As you can see in Figure 2, the master begins the communication by issuing the start condition (S). The master continues by sending a unique 7-bit slave device address, with the most significant bit (MSB) first. The eighth bit after the start, read/not-write (), specifies whether the slave is now to receive (0) or to transmit (1). This is followed by an ACK bit issued by the receiver, acknowledging receipt of the previous byte. Then the transmitter (slave or master, as indicated by the bit) transmits a byte of data starting with the MSB. At the end of the byte, the receiver (whether master or slave) issues a new ACK bit. This 9-bit pattern is repeated if more bytes need to be transmitted. In a write transaction (slave receiving), when the master is done transmitting all of the data bytes it wants to send, it monitors the last ACK and then issues the stop condition (P). In a read transaction (slave transmitting), the master does not acknowledge the final byte it receives. This tells the slave that its transmission is done. The master then issues the stop condition. (ref.: embedded.com)

I2C protocol  [figure 2 Structur of I2C data protocol]

Let’s Code It 

After introduced how I2C bus is configured and how data protocol is arranged, let’s code it! In my implementation, I use AT89S52 microcontroller and SDCC as C compiler.

From above explanation, so we need to built at least 4 elements, i.e. START bit, ADDRESS byte, ACKNOWLEGDE bit, DATA byte (similar to ADDRESS byte), and STOP bit.

Preparation

Before go to code to produce i2c signal, let’s make some initializations. 

#define    SCL    P3_6
#define    SDA    P3_7
#define    I2C_DELAY    0x0F

That is we allocate two pin for SCL pin and SDA pin, and a delay constant. We will need a delay to tuning the speed, I just use looping method. Notice that another compiler use different way to access bit, e.g. Franklin use P1^0 instead of P1_0 to access bit-0 of port P1.

/* memberi delay pada sinyal I2C */
void i2c_delay(void)
{
    unsigned char i;
    for(i=0;i<I2C_DELAY;i++);
}

START and STOP bits

START bit [figure 3 START bit] STOP bit [figure 4 STOP bit]

Figure 3 show how to geneate a START bit, that is drop the SDA low while SCL is high, then drop the SCL low too. Figure 4 show how to generate a STOP bit, that is rise up SCL while SDA low then rise up SDA too.

So the code to generate such signal is like below.

/* START bit */ 

// SDA = H-to-L saat SCL = H, kemudian LOW-kan keduanya
void i2c_start(void)
{
    if(SCL) SCL = 0; // pastikan LOW
   
    // high-kan dulu keduanya
    SDA = 1;
    SCL = 1;
   
    i2c_delay();
    SDA = 0;
    i2c_delay();
    SCL = 0;
}

/* STOP bit */
// SDA = L-to-H saat SCL = H, kemudian HIGH-kan keduanya
void i2c_stop(void)
{
    if(SCL) SCL = 0;
   
    // low-kan dulu keduanya
    SDA = 0;
   
    i2c_delay();
    SCL = 1;
    i2c_delay();
    SDA = 1;
}

ADDRESS and DATA byte

Once START bit has been sent, then we ready to send ADDRESS byte. ADDRESS and DATA are similar, the different only in purpose, write mode or read mode, relative to slave. In write mode (slave write data into bus), the bit-0 of ADDRESS byte is set to ‘1′; in read mode (slave read data from bus), the bit-0 of ADDRESS byte is set to ‘0′.

So there will be two function, write and read. Figure 5 show how SCL signal in every bits in SDA.

I2C Data byte  [figure 5 Wave form in data transmission]

That is when try to write/red ‘1′ (or ‘0′) bit, rise up (or pull down) SDA while SCL is low, rise up SCL for a while depend on speed then fall it down. When SCL bit is low, SDA changing is allowed. So the code is like below.

/* menulis data I2C */
// kirim dat bit-per-bit, RETURN : bit ACK
bit i2c_write(unsigned char dat)
{
    bit data_bit;
    unsigned char i;
   
    for(i=0;i<8;i++)
    {
        data_bit = dat & 0x80; // ambil MSB
        SDA = data_bit; // kirim
        i2c_clock(); // beri clock pada SCL
        dat = dat<<1; // geser 1 bit ke kiri (arah MSB)
    }
   
    // high-kan kembali kedua wire
    SDA = 1;
    i2c_delay();
    SCL = 1;
    i2c_delay();
   
    data_bit = SDA; // baca sinyal ACK, 0 jika OK
    SCL = 0;
   
    i2c_delay();
   
    return data_bit; // return ACK, 0 jika valid
}

 /* membaca data I2C */
// membaca bit-per-bit, RETURN : byte data
unsigned char i2c_read(void)
{
    bit rd_bit;
    unsigned char i, dat;
    
    dat = 0x00;
    
    for(i=0;i<8;i++)
    {
        i2c_delay();
        SCL = 1; // high-kan, agar SCL = H-to-L
        i2c_delay();
        rd_bit = SDA; // ambil bit
        dat = dat<<1; // geser data
        dat = dat | rd_bit; // ubah bit yg bersesuaian
        SCL = 0; // baca bit selesai, SDA boleh berubah
    }
    
    return dat;    
}

Oops! I skip something, i.e. ACK. It’s ok, now on it’s turn.

ACKnowledge bit

When an address or data byte has been transmitted onto the bus then this must be ACKNOWLEDGED by the slave(s). In case of an address: If the address matches its own then that slave and only that slave will respond to the address with an ACK. In case of a byte transmitted to an already addressed slave then that slave will respond with an ACK as well. The slave that is going to give an ACK pulls the SDA line low immediately after reception of the 8th bit transmitted, or, in case of an address byte, immediately after evaluation of its address. In practical applications this will not be noticeable*. (ref.: esacademy.com)

* : In my project too ;)

Figure 6 show how ACK bit take an action.

ACK bit  [figure 6 ACK bit]

If you need, here below can generate such condition.

/* memberi sinyal ACKnowlegdment*/
// sinyal SDA L-to-H
void i2c_ack()
{
    SDA = 0;
    i2c_delay();
    i2c_clock; // tanda send data
    SDA = 1;
}

void i2c_noack()
{
    SDA = 1;
    i2c_delay();
    i2c_clock();
    SCL = 1;
}

 

Bliss Them 

That’s all! Put them all together in i2c.h for instance, then include it in your application. Here below is a chop of my code to accessing a byte of memory in EEPROM.

#include <i2c.h>
#define    EEPROM_ID    0xA0    // ID eeprom Atmel24C02 + address = 000

unsigned char eeprom_get(unsigned char addr)
{
    unsigned char dat;
   
    i2c_start();        // start bit, mulai I2C
    i2c_write(EEPROM_ID);    // alamati EEPROM AT24Cxx untuk Write
    i2c_write(addr);
   
    i2c_start();
    i2c_write(EEPROM_ID+1);    // alamati EEPROM untuk Read
    dat = i2c_read();    // ambil data
   
    i2c_noack();
    i2c_stop();        // stop i2c bus
   
    return dat;
}

 

Have a nice coding ;) !

14 March 2008

Development of Tele-operation Mobile Robot

Filed under: microcontroller - Administrator @ 1:23 pm

It’s topic of my final project. I built a robot (in car form) that can be controlled from PC through radio frequency (RF). An interesting point (I think) from my robot is we can program the robot without make any modification to the robot itself. It’s possible by using tele-operation concept, i.e. the robot’s brain is the remote computer, so we only need to write program in PC, not "disturb" the robot at all.

As example, I write the program using image processing method so that the robot can follow the only red coloured ball. It’s fun! My robot follow red ball, when I move the ball, he* chase it! So he can play with red ball. I try to confuse him with miscelanious coloured balls, and still he chase for red ball.

*: I assume that my robot is male 

Here below is the abstract of my final project.

Unmanned vehicle, in mobile robot manifestation, is widely used in monitoring and exploration purpose. Also robotics is widely developed field that grow in computer science trend so that it needs high level data processing (many data and fast processing). Generally microcontroller has not enough memory and MIPS (million instructions per second) to perform high level data processing, but a computer is so weight to be embedded into small robot. Therefore, tele-processing robot has been developed in this final project; robot only process motoric motion while data processing is done in separated computer.

Developed robot system consist of (i) host computer with interface hardware and software to the RF transmitter, and (ii) the robot, it consist of body that capable to crossing the rough surface, RF receiver, DC motor controller, power supply, and transmitter wireless camera.

Testing had been done to obtain information about robot’s performance and to test tele-processing ability. Robot can be controlled up to 44.8 m in open space, able to ascend diagonal plane up to 22.2° in elevation and stair-case up to 2.7 cm in height. Program base on image processing for black line follower robot and red ball follower robot had been made to test the tele-processing ability. Robot follows black line and red ball successfully with other four colored balls in background.

 

You can download my complete final project report here.

 

click to enlarge [figure 1 Manual control window]

click to enlarge [figure 2 Environment as seen by robot, also image processing result]

click to enlarge [figure 3 Body of robot, not so bad ;) ]

With hope and courage… 

-academica memoria- 

Get free blog up and running in minutes with Blogsome
Theme designed by Alex King