transmitting Smart card data from GPIO

By anup sharma

I am trying to access the Smart card from the C8051 micro-controller. I am able to receive the ATR from the smart card after reset . when i try to send commands from the same GPIO line, there is no response from the smart card.

in this program i am using interrupt based technique where whenever the signal at GPIO goes low interrupt is triggered as a result we start receiving the data. but when i send the command this interrupt is not trigrred.

void transmit_smart_data(void)
{
    char j=0,parity,k=0,y=0,q=0;
    puts("smartnr");
    IE_EX0=0;   //disabling interrupt
    P0MDIN |=P0_B7;
    P0MDOUT|=P0_B7;
    while(valid_tx=getchar(),valid_tx!='b')                 //last character of the command is 'a'(asumption)
    {
        valid_data[j]=valid_tx;
    }
    valid_data[j]='z';
    puts("validnr");
       j=0;
        while(valid_data[j]!='z')
        {
           parity=parity_data(valid_data[j]);
           putchar(parity);
             P0_B7=0;
             TMR2RL  = -4550;                  // Init reload values
             TMR2    = TMR2RL;
             TMR2CN_TR2 = 1;
            while(!TMR2CN_TF2H);                   // Wait for overflow
            TMR2CN_TF2H = 0;
            while(k<8)
            {
        if(((valid_data[j])&(1<<q))!=0)  //sending bitwise bit data
        {
           //putchar('1');
            P0_B7=1;
            TMR2CN_TR2 = 1;
            while (!TMR2CN_TF2H);                   // Wait for overflow
            TMR2CN_TF2H = 0;//TMR2CN_TR2 = 0;
            k++;q++;
        }
        else
                {// putchar('0');
                                P0_B7=0;TMR2CN_TR2 = 1;
                                while (!TMR2CN_TF2H);                   // Wait for overflow
                                TMR2CN_TF2H = 0;//TMR2CN_TR2 = 0;
                                k++;q++;
                                    }
                }

            if(parity!=0)
             {
                //putchar('1');
                P0_B7=1;
                    TMR2CN_TR2 = 1;
                    while (!TMR2CN_TF2H);                   // Wait for overflow
                                        TMR2CN_TF2H = 0;//TMR2CN_TR2 = 0;
                                // s
                    }
                else
                {
                    //putchar('0');
                    P0_B7=0;
                    TMR2CN_TR2 = 1;
                    while (!TMR2CN_TF2H);                   // Wait for overflow
                    TMR2CN_TF2H = 0;
                }

                                               P0_B7=1;
                                                TMR2RL  = -(4550*3);                  // Init reload values
                                                TMR2    = TMR2RL;                   // Init Timer2 with reload value
                                                 TMR2CN_TR2 = 1;
                                                 while (!TMR2CN_TF2H);                   // Wait for overflow
                                                TMR2CN_TF2H = 0;
                                                    j++;q=0;k=0;


        }
        puts("data");
        TCON_IE0=0;
                P0MDIN  |= (1<<7);
                P0_B2=1;
        // Configure P0.0 as analog input.
      //  puts("data");
                IE_EX0=1;
}

Source: Stack Overflow

    

CATransform3D: Setting a scale factor

By Avraham Shukron

Short version:
How can I set a specific scale factor to a given CATransform3D?

  • I can’t use CATransform3DScale because it’ll apply the new scale
    factor on top of the existing one.
  • I can’t use CATransform3DMakeScale because I’ll lose the rotation and translation that I have.

Full Version:
In my app I have a 3D model that the user can interact with:

  1. Dragging with one finger will rotate the model around its center.
  2. Pinching with two fingers will scale up/down the model.

The changes to the model are represented by a CATransform3D struct.
The interactions are captured using UIGestureRecognizersPan and Pinch respectively.

I managed to get the rotation right, but I’m struggling with the scaling:
each time the pinch recognizer fire its callback, I get the absolute scale since the gesture began. If I scale the model by this factor every time – It’ll scale exponentially instead of linearly:

-(void) userDidPinch:(UIPinchGestureRecognizer *) recognizer {
    CGFloat scale = MAX(0.5, MIN(recognizer.scale, 2.0));
    CATransform3D transform = self.modelView.modelTransform;
    transform = CATransform3DScale(transform, scale, scale, scale);
    self.modelView.modelTransform = transform;
}

I want to take the absolute scale factor from the UIPinchGestureRecognizer and set it as the scale factor of the transform matrix. How can I do that?

Source: Stack Overflow

    

Making &quot;Viral&quot; Happen

By Keith Goldberg After creating a number of content-driven brand campaigns – some of which have gone certifiably viral – we (at our agency) have amassed loads of experience drawn from trial and error, success and failure, and just plain having our hands in this stuff 24/7. One thing we learned early on about “viral” content is that is doesn’t often happen (um) virally. Yes, sometimes a brand and its agency catch lightning in a bottle, touching a nerve or a funny bone, and it’s off to the races. When this takes place it’s pretty epic. Thing is, this result is impossible to predict.

Source: Social Media Today

    

Dennis Goedegebuure on the Holistic Practice of SEO and Content Marketing

By Rainmaker.FM

Listen to Search & Deploy host Loren Baker and Dennis Goedegebuure discuss content for marketplaces, the power of community and audience, and how that content helps attract links and interaction around e-commerce sites.

In this 38-minute episode of Search & Deploy, Loren and Dennis talk about:

  • Content for communities and content that is user-generated
  • Tapping into your audience from a content and sharing/conversation perspective
  • Building sincere localized content that is not solely SEO driven
  • Producing content that mobilizes communities and loyal groups
  • Guidelines that help users generate content that helps the base site they list products on
  • The challenges and limitations of e-commerce sites and marketplaces
  • Short-sighted content and linking by SEOs … for SEO goals only
  • The Content Pyramid system and the importance of producing foundational content
  • Incorporating video, infographics, and written content
  • Bundling it all together to make sure the site benefits from an SEO, marketing, and branding perspective

Click Here to Listen to

Search & Deploy on iTunes

Click Here to Listen on Rainmaker.FM

About the author

Rainmaker.FM

Rainmaker.FM is the premier digital marketing and sales podcast network. Get on-demand business advice from experts, whenever and wherever you want it.

The post Dennis Goedegebuure on the Holistic Practice of SEO and Content Marketing appeared first on Copyblogger.

Source: Copy Blogger

    

How to Generate a Never-Ending Flow of Blog Post Ideas

By Rainmaker.FM

Ever find yourself scratching your head, trying to figure out what to write about on your blog?

We’ve all been there.

It’s tough to come up with blog post topics week after week, and it’s not easy to keep all those ideas organized, either.

This week on Hit Publish, host Pamela Wilson invited three Copyblogger experts to share their best advice for generating a never-ending flow of blog post ideas.

Tune in to Hit Publish to hear from host Pamela Wilson, Sonia Simone, Jerod Morris, and Demian Farnworth as they discuss:

  • Sonia Simone’s “secret” technique for coming up with a consistent flow of blog topics
  • How to use an editorial calendar to keep your content on track and avoid annoying repetition
  • Why going through life as a “black hole” will help you find content ideas wherever you look

Click Here to Listen to

Hit Publish on iTunes

Click Here to Listen on Rainmaker.FM

About the author

Rainmaker.FM

Rainmaker.FM is the premier digital marketing and sales podcast network. Get on-demand business advice from experts, whenever and wherever you want it.

The post How to Generate a Never-Ending Flow of Blog Post Ideas appeared first on Copyblogger.

Source: Copy Blogger

    

How Neuroscientist Michael Grybko Defines Creativity

By Rainmaker.FM

Have you ever wondered how prolific writers summon vast stores of creativity without seemingly breaking a sweat?

The Writer Files host, Kelton Reid, would like to introduce you to a guest segment where he enlists the help of a neuroscientist to give us a tour of The Writer’s Brain.

He has invited research scientist Michael Grybko — of the Department of Psychology at the University of Washington — to help him define creativity from a scientific standpoint.

He will help us pinpoint where exactly in the brain creative ideas come from, decide if you can teach an old writer new tricks, and test the theory that writers’ brains are similar to professional athletes.

In this 22-minute file, host Kelton Reid and Michael Grybko discuss:

  • How science is expanding our definition of creativity
  • Why memory plays such a big part in writing
  • Why you shouldn’t take your typing skills for granted
  • Where creative ideas come from
  • Can you teach an old writer new tricks?
  • Why staying curious is so important to creativity
  • Are prolific writers like pro athletes?
  • Why “write what you know” is good advice

Click Here to Listen to

The Writer Files on iTunes

Click Here to Listen on Rainmaker.FM

About the author

Rainmaker.FM

Rainmaker.FM is the premier digital marketing and sales podcast network. Get on-demand business advice from experts, whenever and wherever you want it.

The post How Neuroscientist Michael Grybko Defines Creativity appeared first on Copyblogger.

Source: Copy Blogger