Monday, August 22, 2011

Windows 7

Windows 7 Ultimate (x32 x64) bit 2011 Activated – Free MediaFire Download Links

Windows 7 Ultimate (x32 x64) bit 2011 Activated App Poster
GetMediafire Information Image




GetMediafire ScreenShot Image

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 1
Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 2
Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 3

Windows 7 Starter
*********************

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 5
Windows 7 Home Basic is available in emerging markets such as Argentina, Brazil, Chile, the People’s Republic of China, Colombia, India, Pakistan, Panama, Philippines, Mexico, Russia, Thailand, and Turkey. It is not available in developed technology markets countries including in Western and Central Europe, North America, Hong Kong, Australia and Saudi Arabia. Some Aero options are excluded along with several new features. Home Basic, along with other editions sold in emerging markets, include geographical activation restriction, which requires users to activate Windows within a certain region
or country.

Windows 7 Home Premium
*********************

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 6
This edition contains features aimed at the home market segment, such as Windows Media Center, Windows Aero and multi-touch support.

Windows 7 Professional
*********************

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 7
This edition is targeted towards enthusiasts and small-business users. It includes all the features of Windows 7 Home Premium, and adds the ability to participate in a Windows Server domain. Additional features include operating as a Remote Desktop server, location aware printing, Encrypting File System, Presentation Mode, Software Restriction Policies (but not the extra management features of AppLocker) and Windows XP Mode. Like Enterprise, Microsoft will support this edition until 2020.

Windows 7 Enterprise
*********************

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 8
This edition targets the enterprise segment of the market and is sold through volume licensing to companies which have a Software Assurance contract with Microsoft. Additional features include support for Multilingual User Interface (MUI) packages, BitLocker Drive Encryption, and UNIX application support. Not available through retail or OEM channels, this edition is distributed through Microsoft Software Assurance (SA). As a result it includes several SA-only benefits, including a license allowing the operating of diskless nodes (diskless PCs), the running of multiple virtual machines, and activation via VLK. Like Professional, Microsoft will support this edition until 2020.

Windows 7 Ultimate
*********************

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 9
Windows 7 Ultimate contains all of the same features as Windows 7 Enterprise, but unlike the Enterprise edition, it is available to home users on an individual license basis. Windows 7 Home Premium and Windows 7 Professional users are able to upgrade to Windows 7 Ultimate for a fee using Windows Anytime Upgrade if they wish to do so. Unlike Windows Vista Ultimate, the Windows 7 Ultimate edition does not include the Windows Ultimate Extras feature or any exclusive features as Microsoft had stated. However, even though it is the consumer equivalent to Enterprise, Microsoft will only support Ultimate until 2015, as per Home Premium.[/code]

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 10
"N" and "E" editions
E editions
The features in the E Editions are the same as their equivalent full versions, but do not include Internet Explorer. The cost of the E Editions are the same as the full versions, as Internet Explorer can be downloaded without charge from Microsoft for the E Editions.
N editions
The features in the N Editions are the same as their equivalent full versions, but do not include Windows Media Player. The cost of the N Editions are the same as the full versions, as Windows Media Player can be downloaded without charge from Microsoft for the N Editions.

Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 11
Service Pack 1
Microsoft released the first official service pack for Windows 7 on February 22, 2011. This is an important update that includes previously released security, performance, and stability updates for Windows 7. SP1 also includes new improvements to features and services in Windows 7, such as improved reliability when connecting to HDMI audio devices, printing using the XPS Viewer, and restoring previous folders in Windows Explorer after restarting.
Windows 7 Service Pack 1 is an update that does the following :

- Helps keep PCs supported.
- Provides ongoing improvement to the operating system, by including previous updates delivered over Windows Update as well as continuing incremental updates to the Windows 7 platform based on customer and partner feedback.
- Makes it easy for organizations to deploy a single set of updates.

Changes specific to Windows 7

Additional support for communication with third-party federation services
Additional support has been added to allow Windows 7 clients to effectively communicate with third-party identity federation services (those supporting the WS-Federation passive profile protocol). This change enhances platform interoperability, and improves the ability to communicate identity and authentication information between organizations.

Improved HDMI audio device performance
A small percentage of users have reported issues in which the connection between computers running Windows 7 and HDMI audio devices can be lost after system reboots. Updates have been incorporated into SP1 to ensure that connections between Windows 7 computers and HDMI audio devices are consistently maintained.

Corrected behavior when printing mixed-orientation XPS documents
Prior to the release of SP1, some customers have reported difficulty when printing mixed-orientation XPS documents (documents containing pages in both portrait and landscape orientation) using the XPS Viewer, resulting in all pages being printed entirely in either portrait or landscape mode. This issue has been addressed in SP1, allowing users to correctly print mixed-orientation documents using the XPS Viewer.

How to install :
**************

Extract using WinRAR.
- Use ImgBurn** to burn the extracted ISO file called "Windows.7.SP1.ENG.x86-x64.ACTiVATED.GetMediaFire.com"
* You can use any other software for this operation (Nero, Alcohol, CloneCD...)
* Burning speed should not be faster than 4x.
- Restart your computer*.
* You can install it from existing OS, but I'll recommend the clean installation.
- Make sure you've seleceted your DVD-ROM/RW drive as a first boot device (BIOS setup)*
* If you don't know how to do that, check this link http://www.hiren.info/pages/bios-boot-cdrom
- The text message will appear "Press any key to boot from CD or DVD...."
* By pressing the key you're entering the setup.
- Select your language, time and currency and keyboard input (optionaly)
- Click "Install now".
- Choose your edition* (x86 is 32-bit, x64 is 64-bit) depending of CPU type you have.
* Note that if you have less than 4GB of RAM, x64 will be useless.
- Click "I accept".
- Click "Custom (advanced).
- Choose your partition/hdd drive where Win7 should be installed and click format.
* Setup will continue automaticly and it will finish after 15-30 min.
- Next step will be username (Image 17).
- Type your password (if you want).
- Choose the third option for next step.
- Select your time zone.
- Select your current location.
- And the last step will be silent auto-activation*
* Your PC will restart for the last time.

And that would be all about installation. You're in Win.

Activation
***************

This release has integrated RemoveWAT 2.2.6.0.
This tool completely removes Windows Activation Technologies from your sytem and your Windows will be fully activated and fully updateable, plus, you won't have to worry about malicious updates (i.e. KB971033) which can deactivate your copy of Windows.
It runs automaticly and silently after the setup.

x64 Recovery
****************

This release has integrated Windows 7 Recovery Disc which can be used to access a system recovery menu, giving you options of using System Restore, Complete PC Backup, automated system repair and a command-line promptfor manual advanced recovery. Note that you cannot use the Windows 7 Recovery Disc to re-install Windows. It only fixes Windows.

- FAQ -

Q : The ISO is kinda different from the one that Microsoft provides on MSDN. What's changed?
A : A few things. For example, this installation has brand patch, so it will automaticly find
your brand (i.e. MSI, ASUS, HP, DELL, Toshiba...). Second thing : it has integrated x64 recovery
disc. It also has integrated activator. And basicly, that's all.

Q : Ok, but what has been modified in Windows?
A : Actually, nothing. Installation is untouched and all the setting are deafault. The
only thing that has been injected at the end of the setup is RemoveWAT tool which helps you to
activate your copy. But the Windows itself remains completely untouched.

Q : But if it's pirated, can I use Windows Update?
A : Yup. Feel free!

Q : So, will it ever get deactivated...?
A : Probably not. But that depends both of Microsoft and you. In other words, if you are
carefull with Windows Update there's nothing not worry about. Keep the auto-updates off
and do it manually by reading the description of every new update..

If you have problems with Microsoft Security Essentials :

1. Restore WAT and reboot.
2. Download MSE :

http://www.microsoft.com/security_essentials/default.aspx

3. Install
4. Remove WAT.

RemoveWAT is located in :
\\sources\Windows 7 Ultimate (x32 x64) bit 2011 ActivatedoemWindows 7 Ultimate (x32 x64) bit 2011 Activated\Windows 7 Ultimate (x32 x64) bit 2011 ActivatedWindows 7 Ultimate (x32 x64) bit 2011 Activated\Setup\scripts\faXcooL.exe[/code]
Windows 7 Ultimate (x32 x64) bit 2011 Activated App screenshot 12

Thursday, August 18, 2011

Controlling a Nokia 6100 Display with an Atmel-AVR

What are we going to do tonight, Brain?

Bild 1: What are we going to do tonight, Brain?

The Display (which is used in Nokia 6100, 7210, 6610, 7250 and 6220) has a resolution of 132x132 Pixel @4096 Colors. The visible area is about 3cm x 3cm in size. It can be found cheap at *bay. Note that there exist three types of Displays:

  • Green PCB: Epson S1D15G10 Chipset
  • Orange/Brown PCB with solder pins: Philips PCF8833 Chipset
  • Orange/Brown PCB: ?

The provided Software does only work with Displays with the Philips chipset. If you want to use a Display with S1D15G10-chipset, take a look here: http://www.e-dsp.com/controlling-a-color-graphic-lcd-epson-s1d15g10-controller-with-an-atmel-avr-atmega32l/

Hardware

I have used a AVR ATMega8 to control the Display.
The display works at 3,3V. I use a voltage divider (1.8k, 3.3k to GND) to convert the 5V signals of the controller to 3,3V levels for the display.

I directly soldered a ribbon cable on the back side of the display.

Nokia 6100 Display Pinout

Bild 2: Nokia 6100 Display Pinout

Pinout and connection to AVR:

1 VDD 3,3V
2 /Reset PB4
3 SDATA PB3
4 SCLK PB5
5 /CS PB2
6 VLCD 3,3V
7 NC
8 GND
9 LED-
10 LED+ (6V)
11 NC

no responsibility is taken for the correctness of this information.

Test

With the 8-Bit AVR Microcontroller i have build a rainbow-Animation, a simple oscilloscope and a Wireframe-3D-Engine:

Video 1: Rainbow-Animation

Video 2: Simple oscilloscope

Video 3: 3D Engine based on ATMega8 AVR

Software

The Software can be compiled with AVR-GCC. It display a test picture first.
It is possible to upload a RAW-RGB-Image-File via the serial interface.

Test image

Bild 3: Test image

Test image: Spiderman

Bild 4: Test image: Spiderman

Test image: Yeti

Bild 5: Test image: Yeti

Test image: Winamp

Bild 6: Test image: Winamp

nokia_6100_display_test.zip (42 KB) -

Externer LinkPhilips/NXP PCF8833 Datasheet

Saturday, August 13, 2011

crack

The Tools
To perform this hack you will be needing -
  1. Any De-assembler (I use Hackers Disassembler and Hview )
  2. Resource Hacker
  3. A patch Creator ( Use Universal Patch Creator or Code fusion)
You will be able to get them by googling ..

How to Reverse Engineer?
You need to have a bit knowledge of assembly language,and in case you don't have it,just cram the steps and it will work anytime,every time. Download the latest version of WinRAR from their website and install it.
I will be cracking Winrar 3.80 here (cuz I already have it:P ). This is basically a 2 step process ( 4 step ,if you want to do things with a professional touch,period) .
Install WinRAR - www.theprohack.com
Now copy the WinRAR.exe file to desktop. Make a copy of it there.

Step 1 – Hunting for Memory Address
Now load Hackers Disasembler and load the copy in it.

Open Hackers Disassembler and load copy of Winrar in it - www.theprohack.com

The Disassembler will disassemble the executable in assembly code. Now you need to search for strings that are used in WinRAR program. Press Ctrl + F and type “evaluation” without quotes and search in the assembly code. Hit enter..

Reach this block of code using search function - www.theprohack.com

After you have reached this block of code by searching, just look at the block of code above it. There you will find that some assembly values are being compared and then code is jumped to some other function. Now see carefully, the “evaluation copy” function must be invoked after some specific condition is met. We need to look for it at the code and the make certain changes to the condition so that the program doesn't checks for the condition.

We need to edit this code,but first note memory address - www.theprohack.comWe need to edit this code,but first note memory address - www.theprohack.com
In the above code you can see this code -
00444B6A: 803DF4B84B0000 cmp byte ptr [004BB8F4], 00
00444B71: 0F859B000000 JNE 00444C12
This is the code responsible for validating you as a legal user :) . Just note down the memory address that leads to jump (JNE) at some memory location. In this case, note down 00444B71 .
Note : For any WinRAR version, this code and memory address might be different,but the JNE will be same. Just note down the respective memory address that checks.
Now you need to search for the code that brings that ugly nag screen “Please purchase WinRAR license” after your trial period of 40 days is over. For this,look over your toolbar and click on “D” which stands for looking for Dialog references.
Hit the D in toolbar - www.theprohack.com

Now in the dialog box that opens,search for “please” and you will get the reference as -
ID-REMINDER, “Please purchase WinRAR license”
Search in dialog references - www.theprohack.com

Double click on it and you will reach the subsequent code.

Note down the location of REMINDER dialog code - www.theprohack.com
The code will be something like
* String: “REMINDER”
0048731A: 68EB5E4B00 push 004B5EEB
Just note the memory address that invokes the REMINDER dialog. In this case its 0048731A. Note it down.
Note : For any WinRAR version, this code and memory address might be different.But the Reminder Memory address code will always PUSH something. Just note down the respective memory address that PUSH ‘s.


Step 2 – Fixing and Patching
Now in this step we will be patching up values of memory addresses we noted earlier. I will be doing this using HVIEW.
Now load the copy you disassembled in Hacker’s Disassembler in Hview.

Open HVIEW and open the EXE in it - www.theprohack.com

After you have loaded it, you will see the code is unreadable. Its just like opening an EXE file in notepad. You need to decode it. To do that, just press F4 and yoiu will get an option to decode it. Hit DECODE and you will be able to see code in the form of assembly code and memory addresses.

Decode the code by pressing F4- www.theprohack.com

After you have done that, you need to search for memory addresses you noted down earlier. Just hit F5 and a search box will be there. Now you need to enter the memory address. To do that, enter a “.” and the type memory address neglecting the earlier “00” . The “.” will suffice for “00”. ie -
Type .444B71 in place of 00444B71
search using F5 - www.theprohack.com

and search in the code.

reach the code - www.theprohack.com

After you have reached the respective code, you need to make changes to it. Press F3 and you will be able to edit the code.Now make the following changes -

Change the values- www.theprohack.com

After you have done it, save it by pressing F9.
Now search for next memory location by pressing F5 and entering it. Reach there and make the following changes by pressing F3 -

Offset patching - www.theprohack.com

Save the changes by pressing F9 and exit HVIEW by pressing F10.
Congrats..You have cracked WinRAR :) Replace the original WinRAR.exe with this copyofwinrar.exe by renaming it. It will work 100% fine :P

Step 3 – Spicing up the EXE
Now U have a 100% working version of EXE, you might want to change your registration information in WinRAR. TO do this, you can use Resource hacker.

We need to change registration info - www.theprohack.com

Launch Resource Hacker, load the copyofwinrar.exe in it

Use resource hacker and open the file - www.theprohack.com

Now go to DIALOG –> Expand tree –> ABOUTRARDLG and click it. Now Find Trial copy line and replace it with your favorite one :P

make changes and compile them - www.theprohack.com

and click on Compile Script button.

yup..thats the final result - www.theprohack.com

Now save the file with any name on your desktop or any location what so ever.

save your exe - www.theprohack.com

Now you have a fully patched WinRAR.exe file :)) . If you want to learn that, move on to next step.

Step 4 – Creating a working Patch (or giving Professional touch :P )
I will be using diablo2oo2's Universal Patcher (UPE) for creating the patch. The patch will work like any authentic one for that WinRAR version. Just like the one U downloaded at anytime of your life from any Crack and Keygen website.
Launch Patch Creator and click on add new project. Enter project Information and click on save.

Launch the patcher and setup it - www.theprohack.com

Click on Add – ; Offset patch


Create Offset patch - www.theprohack.com

After you have done that, double click on offset patch and then
  1. Give path of original winrar.exe
  2. Give path of unmodified Winrar.exe (again)
  3. Give path for fully patched Winrar.exe (ie Cracked Winrar.exe in this case)
  4. Click on compare and it will show difference between both files
  5. Click on save.
Compare executables - www.theprohack.com
Now in the next window, click on Create Patch and save it. The Patch will be created. Now copy it in WinRAR installation directory and hit on patch, it WILL work.

Create your patch - www.theprohack.com

Congrats you have created a patch of your own and have learned to reverse engineer WinRAR :)

Run the patch and it will work :) - www.theprohack.com

You can crack other software in the same way…just practice,debug and disassemble and you will get the way :)

Tuesday, July 26, 2011

cmucam

//PIC: PIC16F877A
//Crystal Frequency: 20MHz
//Compiler: HI-TECH ANSI C



#include
#include
__CONFIG(0x3F32);
#define LCD_RS RD0
#define LCD_RW RD1
#define LCD_EN RD2
#define LCD_LIGHT RD3
#define LCD_DATA PORTD //D7-D4
#define LCD_PULSE() ((LCD_EN=1),(LCD_EN=0))
#define BAUD 9600
#define _XTAL_FREQ 20000000

void pic_init(void);
void uart_init(void);
void lcd_init(void);
void lcd_write(unsigned char c);
void lcd_clear(void);
void lcd_goto(unsigned char pos);
void lcd_string(const char *s);
void convert(unsigned int no, char base);
void display(char number);
void uart_transmit(char data);
void uart_string(const char *s);

char mode,cam[40],di[10],z,rec[]={"ACK"};
unsigned int counter[2];

static void interrupt isr(void)
{char i;
if(RCIF==1){
counter[0]=0;
if(RCREG=='T') z=0;
cam[z]=RCREG;
if(z<38) z++;} if(TMR0IF==1){ TMR0IF=0; if(counter[0]<20000) counter[0]++; if(counter[0]==5000) z=0; } } main() {int i,j,space,value[8]; pic_init(); //initialize PIC uart_init(); //initialize UART lcd_init(); //initialize LCD lcd_goto(0x00); //select first line lcd_string(" CMUCAM EXAMPLE "); //display string lcd_goto(0x40); //select second line lcd_string(" "); //display string lcd_goto(0x14); //select third line lcd_string(" "); //display string lcd_goto(0x54); //select fourth line lcd_string(" "); //display string LCD_RS=0; lcd_write(0x40); LCD_RS=1; for(i=0;i<=63;i++) lcd_write(0b00000); mode=0; counter[1]=0; for(;;){ counter[1]++; switch(mode){ case 0:{ if(counter[1]==1){ for(i=0;i<=39;i++) cam[i]=0x20; lcd_goto(0x40); //select second line lcd_string("RS "); //display string uart_string("RS"); uart_transmit(0x0D);} //Enter else if(counter[1]==1000){ counter[1]=0; j=0; for(i=0;i<=2;i++){ if(cam[i]==rec[i]) j++;} if(j==3){ counter[1]=0; mode++;}} lcd_goto(0x14); //select third line LCD_RS=1; for(i=0;i<=19;i++) lcd_write(cam[i]); lcd_goto(0x54); //select fourth line LCD_RS=1; for(i=20;i<=39;i++) lcd_write(cam[i]); break;} case 1:{ if(counter[1]==1){ for(i=0;i<=39;i++) cam[i]=0x20; lcd_goto(0x40); //select second line lcd_string("CR 18 44 "); //display string uart_string("CR"); uart_transmit(0x20); //Space uart_string("18"); uart_transmit(0x20); //Space uart_string("44"); uart_transmit(0x0D);} //Enter else if(counter[1]==1000){ counter[1]=0; j=0; for(i=0;i<=2;i++){ if(cam[i]==rec[i]) j++;} if(j==3){ counter[1]=0; mode++;}} lcd_goto(0x14); //select third line LCD_RS=1; for(i=0;i<=19;i++) lcd_write(cam[i]); lcd_goto(0x54); //select fourth line LCD_RS=1; for(i=20;i<=39;i++) lcd_write(cam[i]); break;} case 2:{ if(counter[1]==1){ for(i=0;i<=39;i++) cam[i]=0x20; lcd_goto(0x40); //select second line lcd_string("TC 0 40 0 40 0 40 "); //display string uart_string("TC"); uart_transmit(0x20); //Space uart_string("0"); uart_transmit(0x20); //Space uart_string("40"); uart_transmit(0x20); //Space uart_string("0"); uart_transmit(0x20); //Space uart_string("40"); uart_transmit(0x20); //Space uart_string("0"); uart_transmit(0x20); //Space uart_string("40"); uart_transmit(0x0D);} //Enter for(i=0;i<=7;i++) value[i]=0; space=0; i=2; do{ if((cam[i]<0x30)|(cam[i]>0x39)) space++;
else value[space]=10*value[space]+cam[i]-0x30;
i++;}
while(space!=8);

lcd_goto(0x14);
lcd_string(" ");
convert(value[0],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");
convert(value[1],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");
convert(value[2],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");
convert(value[3],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");

lcd_goto(0x54);
lcd_string(" ");
convert(value[4],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");
convert(value[5],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");
convert(value[6],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");
convert(value[7],10);
for(i=2;i>=0;i--) display(di[i]);
lcd_string(" ");
break;}
default:{
mode=0;
break;}}
}}

void pic_init(void)
{
TRISA=0b00000000;
TRISB=0b00000000;
TRISC=0b10000000;
TRISD=0b00000000;
TRISE=0b00000000;
OPTION=0b00000000;
ADCON1=0b00000110;
INTCON=0b11100000;
PIE1=0b00100000; //Enable RX interrupt
PORTA=0b00000000;
PORTB=0b00000000;
PORTC=0b00000000;
PORTD=0b00000000;
PORTE=0b00000000;
}

void uart_init(void)
{
TXSTA=0b10100100;
RCSTA=0b10010000;
SPBRG=(int)(_XTAL_FREQ/(16.0*BAUD)-1);
}

/* initialise the LCD - put into 4 bit mode */
void lcd_init(void)
{
__delay_ms(15); //delay for LCD Power Up
lcd_write(0x28); //function set
lcd_write(0x0C); //display on/off control
lcd_clear(); //clear screen
lcd_write(0x06); //entry mode set
LCD_LIGHT=1;
}

/* write a byte to the LCD in 4 bit mode */
void lcd_write(unsigned char c)
{
LCD_DATA=(LCD_DATA&0x0F)|(c&0xF0);
LCD_PULSE();
LCD_DATA=(LCD_DATA&0x0F)|((c<<4)&0xF0);
LCD_PULSE();
__delay_us(40);
}

/* clear LCD and goto home */
void lcd_clear(void)
{
LCD_RS=0;
lcd_write(0x1);
__delay_ms(2);
}

/* write a string of chars to the LCD */
void lcd_string(const char *s)
{
LCD_RS=1;
while(*s)
lcd_write(*s++);
}

/* go to the specified position */
void lcd_goto(unsigned char pos)
{
LCD_RS=0;
lcd_write(0x80+pos);
}

void convert(unsigned int no, char base)
{char i;
for(i=0;i<=9;i++) di[i]=0;
i=0;
do{
di[i]=no%base;
no=no/base;
i=i+1;}
while(no!=0);
}

void display(char number)
{switch(number){
case 0:{lcd_string("0");break;}
case 1:{lcd_string("1");break;}
case 2:{lcd_string("2");break;}
case 3:{lcd_string("3");break;}
case 4:{lcd_string("4");break;}
case 5:{lcd_string("5");break;}
case 6:{lcd_string("6");break;}
case 7:{lcd_string("7");break;}
case 8:{lcd_string("8");break;}
case 9:{lcd_string("9");break;}
case 10:{lcd_string("A");break;}
case 11:{lcd_string("B");break;}
case 12:{lcd_string("C");break;}
case 13:{lcd_string("D");break;}
case 14:{lcd_string("E");break;}
case 15:{lcd_string("F");break;}
default:{lcd_string("?");break;}
}}

void uart_transmit(char data){
while(TXIF==0) continue;
TXREG=data;
}

void uart_string(const char *s)
{
while(*s)
uart_transmit(*s++);
}

Wednesday, July 13, 2011

Board Description

You can power the board by USB bus.
The USB can supply 500mA, so there is enough power to drive relays and displays. The microcontroller has a USB port on board . You can drive up to 8 relays and read the status of 8 optocoupler. You can use this inputs for switches, push buttons, or to have a feed back to see if the relays have been effectively switched. The communication protocol between PC and board is very simple, for example, sending the character "6" on the virtual RS232 the first relay will turn on and the board will replay with an "I" character, this response is an acknowledge and makes you sure that the command arrived and was correctly executed.


scheda rele opto

HW description

The board is made of:

  • PCB;
  • microcontroller Microchip (18f2455 -see the Datasheet) with 32 Kb off flash memory, 256 byte of Eeprom memory and controller USB;
  • Optocoupler for input (TPL4N25-4).
  • USB Connector
  • Relays. We can mount two type of relay, one with maximum 30Vcc (or
    125Vac) or another with 230Vac, 2A contact.

Schematics

Schematic USB Board
Fig. 1

Schematic USB Board (2)
Fig. 2

Firmware description

The board firmware receives a command from the PC (using the get function) elaborate the command (by ProcessIO function) and executes the command(toggle the relay or read the input).
This is and example of the source code of the firmware:


void main(void) { /* A7  A6  A5  A4  A3  A2  A1  A0 */ /*    1     1     1     1    1     1     0     0 */ LATA &= 0x0; TRISA &= 0xFC; /* configure port A of uC */ /* B7 B6 B5 B4 B3 B2 B1 B0  */ /*    1   1    1    1   1    1   1    1  */ LATB &= 0x0; TRISB &= 0xFF; /* configure port B of uC */ /* C7 C6 C5 C4 C3 C2 C1 C0 */ /*   0    0    1    1   1    1   0    0 */ LATC &= 0x0; TRISC &= 0x3C; /* configure porta C of uC */ InitializeSystem(); mLED_1_Off();  MSB_num_restart = ReadEEPROM(0x20); LSB_num_restart = RedEEPROM(0x21); if ((MSB_num_restart == 0xFF)&(LSB_num_restart == 0xFF)){   /* blank eeprom */ MSB_num_restart = 0 ; LSB_num_restart = 0 ;  WriteEEPROM ( 0x20, 0); WriteEEPROM ( 0x21, 0); } else {  if (LSB_num_restart == 0xFF){  MSB_num_restart = MSB_num_restart +1; WriteEEPROM ( 0x20, MSB_num_restart); WriteEEPROM ( 0x21, 0); LSB_num_restart = 0; } else {  LSB_num_restart = LSB_num_restart +1; WriteEEPROM ( 0x21, LSB_num_restart); } } EnablePullups();     /* enable pull-up on PORTB */ while(1) { USBTasks();        /*  USB Tasks  */ ProcessIO();        /* See user\user.c & .h */ } } void ProcessIO(void) {    if((usb_device_state < CONFIGURED_STATE)||(UCONbits.SUSPND==1)) return; if(getsUSBUSART(input_buffer,1)){ ... if(input_buffer[0] == '6') /* 0x36 */ { if(mUSBUSARTIsTxTrfReady()){ mRele_1_On();                /* turn on relay number 1*/ putrsUSBUSART("I");    /* acknoledge */ } } ... } }
void main(void) { /* A7 A6 A5 A4 A3 A2 A1 A0 */ /* 1 1 1 1 1 1 0 0 */ LATA &= 0x0; TRISA &= 0xFC; /* configure port A of uC */ /* B7 B6 B5 B4 B3 B2 B1 B0 */ /* 1 1 1 1 1 1 1 1 */ LATB &= 0x0; TRISB &= 0xFF; /* configure port B of uC */ /* C7 C6 C5 C4 C3 C2 C1 C0 */ /* 0 0 1 1 1 1 0 0 */ LATC &= 0x0; TRISC &= 0x3C; /* configure porta C of uC */ InitializeSystem(); mLED_1_Off(); MSB_num_restart = ReadEEPROM(0x20); LSB_num_restart = RedEEPROM(0x21); if ((MSB_num_restart == 0xFF)&(LSB_num_restart == 0xFF)){ /* blank eeprom */ MSB_num_restart = 0 ; LSB_num_restart = 0 ; WriteEEPROM ( 0x20, 0); WriteEEPROM ( 0x21, 0); } else { if (LSB_num_restart == 0xFF){ MSB_num_restart = MSB_num_restart +1; WriteEEPROM ( 0x20, MSB_num_restart); WriteEEPROM ( 0x21, 0); LSB_num_restart = 0; } else { LSB_num_restart = LSB_num_restart +1; WriteEEPROM ( 0x21, LSB_num_restart); } } EnablePullups(); /* enable pull-up on PORTB */ while(1) { USBTasks(); /* USB Tasks */ ProcessIO(); /* See user\user.c & .h */ } } void ProcessIO(void) { if((usb_device_state < CONFIGURED_STATE)||(UCONbits.SUSPND==1)) return; if(getsUSBUSART(input_buffer,1)){ ... if(input_buffer[0] == '6') /* 0x36 */ { if(mUSBUSARTIsTxTrfReady()){ mRele_1_On(); /* turn on relay number 1*/ putrsUSBUSART("I"); /* acknoledge */ } } ... } }

The ProcessIO() function waits for a command. On this example when the board receives the "6" character on virtual RS232 (the USB) the first relay will turn on and answer with "I" character. You can also read how many time the board has been turned on, this counter is saved on the eeprom memory inside the PIC microcontroller.

Software description

Here is an example of software written with Visual Basic. From left ToolBox import the "SerialPort" control. We will use 3 functions of this control, which are: Open, Write, Read

Let's start opening the serial port, with SerialPort.Open.

The SerialPort.Open needs a serial port number to be opened; it is the number
of the virtual serial port (usually it is COM4).
After the virtual serial port is opened, you can send commands using
SerialPort.Write function, for example if you want to turn on the first relay:
SerialPort.Write("6")

To read the answer from the board and to acknowledge the command received
use the SerialPort.Read function

scheda rele visual basic

Command protocol

Send 0 = 0x30 = 48 => Turn on Led and answer  "A" Send 2 = 0x32 = 50 => Turn off Led and answer  "C" Send 5 = 0x35 = 53 => if the puss button is pressed, answer  "G"  otherwise "H" Send 6 = 0x36 = 54 => Turn on Relay 1 and answer  "I" Send 7 = 0x37 = 55 => Turn off Relay 1 and answer  "L" Send 8 = 0x38 = 56 => Turn on Relay 2 and answer  "M" Send 9 = 0x39 = 57 => Turn off Relay 2 and answer  "N" Send a = 0x61 = 97 => Turn on Relay 3 and answer  "O" Send b = 0x62 = 98 => Turn off Relay 3 and answer  "P" Send c = 0x63 = 99 => Turn on Relay 4 and answer  "Q" Send d = 0x64 = 100 => Turn off Relay 4 and answer  "R" Send e = 0x65 = 101 => if input 1 is on, answer  "S" otherwise "T" Send f = 0x66 = 102 => if input 2 is on, answer  "U" otherwise "V" Send g = 0x67 = 103 => if input 3 is on, answer  "W" otherwise "Y" Send h = 0x68 = 104 => if input 4 is on, answer  "J" otherwise "K" Send i = 0x69 = 105 => if input 5 is on, answer  "Z" otherwise "a" Send l = 0x6C = 108 => if input 6 is on, answer  "b" otherwise "c" Send m = 0x6D = 109 => if input 7 is on, answer  "d" otherwise "e" Send n = 0x6E = 110 => if input 8 is on, answer  "f" otherwise "g" Send o = 0x6F = 111 => Turn on Relay 5 and answer  "H" Send p = 0x70 = 112 => Turn off Relay 5 and answer  "B" Send q = 0x71 = 113 => Turn on Relay 6 and answer  "D" Send r = 0x72 = 114 => Turn off Relay 6 and answer  "E" Send s = 0x73 = 115 => Turn on Relay 7 and answer  "F" Send t = 0x74 = 116 => Turn off Relay 7 and answer  "G" Send u = 0x75 = 117 => Turn on Relay 8 and answer  "X" Send v = 0x76 = 118 => Turn off Relay 8 and answer  "m" 

You can also read how many time the board has been powered up:

Send w = 0x77 = 119 => Read the Most significant part of number of restart Send z = 0x7A = 122 => Read the Least significant part of number of restart 
SW_PC_Relay_USB.zip289.38 KB