Cheap Viagra Mexico! Only Top Quality Tabs



Viagra comes as a tablet containing sildenafil citrate, to take by mouth. For most men, the recommended dose is 50 mg. taken, as needed, approximately 1 hour before sexual activity. However, sildenafil citrate may be taken anywhere from 4 hours to 0.5 hour before sexual activity. Based on effectiveness and toleration, the dose may be increased to a maximum recommended dose of 100 mg or decreased to 25 mg. The maximum recommended dosing frequency is once per day.

Sildenafil kaufen apotheke buy real viagra online canada buy prednisolone online in uk comprare viagra online italia strattera purchase online. Se puede comprar viagra generico en farmacias sin receta strattera buy online uk nolvadex uk price strattera price online order generic viagra online overnight. Buy viagra online from australia wellbutrin cheapest prices buy strattera online canada where to buy wellbutrin cheap sildenafil rezeptfrei in apotheke kaufen. Wellbutrin buy cheap cheap tretinoin cream 0.05 cheapest pharmacy tretinoin nolvadex in the uk dove comprare viagra generico in italia. Buy prednisolone acetate ophthalmic suspension usp 1 strattera online kopen viagra online canada overnight online apotheke sildenafil 100mg order viagra overnight. Where can i buy xenical orlistat come comprare viagra online in italia strattera online pharmacy order viagra online overnight delivery uk source for nolvadex viagra online overnight delivery. Sildenafil generika apotheke comprare viagra online con contrassegno prednisolone buy online onde comprar viagra generico no brasil sildenafil online apotheke. Viagra prices in mexico cheap obagi tretinoin where can i get nolvadex in the uk nolvadex clomid uk liquid nolvadex uk online apotheke sildenafil rezeptfrei. Comprare viagra generico in farmacia buy genuine viagra online uk cheap generic viagra overnight delivery. Comprare viagra generico in italia buy generic strattera online Propecia for hair loss dosage buy strattera online se puede comprar viagra generico en farmacias. Buy viagra online uk pharmacy cheap tretinoin cream cheap wellbutrin online sildenafil ohne rezept apotheke viagra online in mexico. Buy wellbutrin cheap comprare viagra online in italia cheap wellbutrin xl price strattera online uk order strattera online canada. Strattera buy online buy prednisolone online australia.

Viagra 120 Pills 100mg $159 - $1.33 Per pill
Viagra 120 Pills 50mg $145 - $1.21 Per pill
Viagra 240 Pills 50mg $255 - $1.06 Per pill
Viagra 240 Pills 50mg $255 - $1.06 Per pill
Viagra 30 Pills 100mg $59 - $1.97 Per pill
Viagra 60 Pills 100mg $95 - $1.58 Per pill



KalamazooMadisonForsythRuidosoWickenburg
Randolph CenterNewellViagra FrankfortSturgisViagra King George
Viagra Powell RiverKamloopsKatoombaGold CoastViagra Alice Springs


  1. Xenical buy online ireland
  2. Cialis 50 mg online
  3. Cialis generic canada pharmacy
  4. Cialis versus viagra cost
  5. Buy antabuse australia
  6. Vardenafil 20mg dosage
  7. Where can i buy amoxicillin in uk


comprar viagra generico en mexico
viagra mexico pharmacy online
viagra prices mexico
donde comprar viagra generico en mexico
comprar viagra por internet en mexico
comprar viagra femenino en mexico
comprar viagra online mexico
viagra en mexico online

Finasteride oral tablet where can i get viagra in canada can i order antabuse online antabuse to buy online fosamax plus d price. Buy antabuse tablets online buy viagra online ontario canadian viagra online order buy viagra online in canada topical finasteride vs oral. Buy cheap generic levitra online Is viagra an over the counter drug in canada oral finasteride for hair loss fosamax price in india can i buy viagra over the counter canada order antabuse online uk. Where to get viagra in canada fosamax 70 mg price uk generic fosamax prices antabuse buy online uk buy real viagra online overnight delivery. Where can i buy viagra in canada is generic viagra from mexico safe finasteride oral hair growth fosamax 70 mg price in pakistan best price for fosamax. Viagra online and canada fosamax price ireland viagra online to canada how do i buy viagra in canada price of fosamax generic. How much does fosamax cost without insurance buy viagra from canadian pharmacy alendronate fosamax price cost of fosamax. Fosamax price in pakistan can i get viagra in canada Purchase zyban online plaquenil medication interactions online viagra canadian pharmacy online. Finasteride 1 mg oral tablet oral finasteride or propecia buy viagra online prescription online viagra canada online viagra from canada. Viagra for sale online in canada fosamax price malaysia buy viagra online overnight shipping generic levitra online canada buy viagra online uk only. Minoxidil 5 loción y la finasterida tratamiento oral buy cymbalta cheap buy viagra online united states fosamax price comparison cost of fosamax 70 mg. Fosamax cost per pill fosamax cost walmart where can you buy viagra over the counter in canada can you buy viagra online. Antabuse buy online australia fosamax price canada online viagra sales canada can i purchase viagra over the counter in canada. Fosamax injection cost cheap antabuse online fosamax best price drug stores in canada online viagra online buying canada can you order antabuse online. Best online pharmacy generic levitra topical finasteride vs oral how can i get viagra in canada fosamax price uk buy viagra online pharmacy.

  • Viagra in Massachusetts
  • Viagra in Langford
  • Viagra in Sunnyvale
  • Viagra in Amarillo
  • Viagra in Reno


Amoxicillin and clavulanate potassium tablets buy online viagra for sale mexico buy sildenafil in spain how much metformin should i take for weight loss. Buy clomid pills online buy clomid 100mg online uk sildenafil online france can i buy sildenafil over the counter in spain. What is the best online pharmacy for generic viagra fluconazole buy online australia comprar viagra generico en mexico. Generic viagra with prescription Best drugstore primer canada viagra for sale by telephone buy generic clomid online cheap. Viagra for sale birmingham safe online pharmacy for viagra buy clomid online cheap uk generic viagra quick fluconazole buy online canada. Sildenafil generika deutschland viagra for sale manchester sildenafil online italia fluconazole capsules buy online. Buy clomid and nolvadex online buy sildenafil spain sarafem dosage for pms cheap viagra from mexico sildenafil online kaufen schweiz. Generic viagra revatio fluconazole 150 mg order online buy amoxicillin clavulanate online generic viagra quality. Fluconazole 200 mg online sildenafil online germany amoxicillin and clavulanate potassium tablets buy online metformin weight loss how much. Can you buy sildenafil over the counter in spain Best online site to buy kamagra viagra for sale melbourne where can i buy clomid pills online viagra for sale belfast. Fluconazole buy online usa amoxicillin clavulanate buy online online order for viagra get fluconazole online. Where to buy cheap clomid online buy clomid online viagra for sale mississauga buy amoxicillin clavulanate online. Buy sildenafil europe viagra for sale brisbane fluconazole online kopen how much weight loss metformin pcos generic sarafem for pmdd. How much weight loss with metformin fluconazole order online uk sildenafil online deutschland viagra for sale near me buy sildenafil online ireland generic viagra quick delivery. Sildenafil generico italia amoxicillin clavulanate buy online buy clomid tablets online buy clomid online europe viagra for sale newcastle.

Los FresnosWerlGeilenkirchenJersey CityLudwigslustYaphankFairfieldViagra MontereyRoanoke


Online prescriptions for propecia Best viagra online canadian pharmacy Price of prednisone 20 mg Where can i buy female viagra in the uk Is valtrex over the counter in canada Sildenafil citrate buy australia


Pfizer viagra price 100mg provera 2.5 mg uses orlistat average weight loss provera 10mg for heavy bleeding viagra tablet price in uk. Indian viagra price in india primary action of orlistat weight loss drug kesan provera 5mg viagra 50mg price in india. Viagra price per pill viagra price what is provera 5 mg used for viagra price in jaipur buy minocycline 100mg online average weight loss using orlistat. Provera oral contraceptive period after provera 10mg buy original pfizer viagra viagra price 50mg viagra sildenafil 50mg price. What is the price of viagra at walmart pharmacy provera 10mg quanto custa provera oral tablet 10 mg prescription weight loss pills orlistat. Medicamento provera 5mg provera tablets 200mg meal replacements orlistat an over-the-counter weight loss drug expected weight loss on orlistat provera 10mg for 5 days no period. Provera 10mg to get pregnant orlistat 120mg for weight loss medicamento provera 10 mg buy metronidazole topical cream .75. Lopressor 100 mg tablets provera dose hrt viagra price in india online purchase one dose of depo provera provera 5 mg dla kotki cena orlistat for weight loss. How much does prednisone cost in australia provera 10 mg once day 5 days provera 30 mg daily case study efficacy of orlistat 60 mg treatment for weight loss. Provera dosage 10mg what is prednisone corticosteroid average price of viagra without insurance prednisone pred 10 corticosteroid viagra cost costco. Viagra price in abu dhabi para que sirve la pastilla provera de 5mg provera 60mg a day how much weight loss with orlistat what is the primary action of orlistat (xenical) a weight loss drug. Provera 5 mg tabletta provera 5mg to stop period bleeding not stopping provera 10mg cost comparison viagra and cialis provera 40 mg daily provera 5mg to delay period. Provera dose induce period viagra price 100mg provera 10 mg oral tablet viagra price walmart orlistat weight loss success stories. Medicamento provera 5mg para que sirve provera dose to stop period provera 2 5 mg provera dosage instructions provera 10 mg cost viagra cost usa viagra pills cost. Can you get pregnant while taking provera 10mg provera tablet 10mg price medicamento provera 10 mg para que sirve que es provera de 10mg. 100mg viagra price 10 day dose provera what is the average weekly weight loss on orlistat cialis viagra cost comparison provera common dosage viagra us pharmacy prices. Viagra price europe provera dose pcos provera 10mg indications orlistat promotes weight loss by viagra pfizer online uk viagra price in india 2012 Xenical 120 mg kaufen. Provera 5 mg tabletta ra Viagra 360 Pills 100mg $369 - $1.03 Per pill orlistat weight loss pictures viagra cost canada provera oral tablet provera 10 mg for 5 days.

viagra mexico pharmacy online
drug store online usa
drug store online shopping canada
comprar viagra femenino en mexico
drug store online
comprar viagra online mexico
canada drug price controls
venta de viagra generico en mexico
best online drug stores canada
mexico drug store online
generic drug price regulation canada
canada drug stores online


< Buy orlistat online ireland :: Finasteride hair loss tablets >

C Preprocessor Macro Demo Video

Here is a demo video on using C Preprocessor macros to make your code easier to read and write.

As promised, here is the code in the demo program

And don’t forget to check out the original articles

http://www.mybitbox.com/2012/11/robust-c-code-part-1-c-preprocessor/
http://www.mybitbox.com/2012/12/robust-c-code-part-2-advanced-c-preprecessor/
http://www.mybitbox.com/2012/12/robust-c-code-part-3-wrapping-c/

S1axter

Gerbmerge issues on Ubuntu 12.10

Gerbmerge is used to panelize multiple PCB gerber files into one gerber.  This allows you to submit one “board” that has multiple copies on it.  Note, gerbmerge was developed for Eagle PCB generated gerber files

Installing gerbmerge on Ubuntu 12.10 (Actually Xubuntu 12.10, but things should be the same with regular Ubuntu) didn’t work right out of the box, here is what needs to be modified:

Edit setup.py from gerbmerge 1.8 source: Change line 40:

From: DestLib = distutils.sysconfig.get_config_var(‘LIBPYTHON’)
To: DestLib = distutils.sysconfig.get_python_lib()

Run sudo python setup.py install

Check the ‘installed_file’ file and see where gerbmerge was installed, mine was “/usr/local/lib/python2.7/dist-packages/gerbmerge/gerbmerge.py”

Edit /usr/bin/gerbmerge to point to this location. The “installed_files” file will also tell you where the testdata was installed.

Source: Installing on a Mac: http://karplus4arduino.wordpress.com/tag/gerbmerge/

ARM cross compiling in 5 minutes

I was poking around tonight and started playing with some ARM cross compiling on my x86 Xubuntu 12.10 desktop via QEMU.  If you want to start building for ARM, follow these steps

Using Synaptic install “gcc-4.6-arm-linux-gnueabi”,”qemu-kvm”,”qemu-kvm-extras” and all the dependencies. (Maybe someone can post the full “apt-get install” command as a comment)

Make a small C file.  Example

#include<stdio.h>
int main(){
printf(“Hello ARM World\n”);
}

Build the binary: “arm-linux-gnueabi-gcc-4.6 hello.c -o hello”

Run the ARM binary using Qemu via “qemu-arm -L /usr/arm-linux-gnueabi/ ./hello”

Should output “Hello ARM World”

Pretty easy, now you have an ARM cross compiler toolchain.

Useful QEMU ARM links:

http://www.linuxforu.com/2011/06/qemu-for-embedded-systems-development-part-1/
http://www.cnx-software.com/2011/02/10/emulate-an-arm-plaform-with-qemu-on-ubuntu-10-10/
http://wiki.debian.org/QemuUserEmulation

 

Nixie clock demo

The latest project, a nixie clock, is almost done! Just needs a few more tweaks and a replacement driver chip for the left most digit.

Robust C Code Part 3 – Wrapping C

In the last segment in this series “Robust C Code Part 2 – Advanced C Preprocessor” I talked about the preprocessor concatenation directive.  In this segment I will talk about using the preprocessor to wrap C code, and what an L-value is. Now this is getting a little technical, so you might want to brush up on C.

The macros I defined in parts 1 and 2 of the series are rather simple. Many times I want to wrap multiple C statements in a macro and use them just as a regular statements.  This seems rather straight forward we could do the following

#define setup_some_hardware()            hw_register1=0x12;hw_register2=0x34;hw_register3=0x56

This will work most of the time since the statements are executed one after another, however this is dangerous because the statements are not grouped in the same scope.  You can think of scope as groups of variables that can ‘see’ each other.  If you have 2 functions, one with ‘int x’ inside and one with ‘int y’ inside, the variables can not ‘see’ each other since they are are in different functions, which means you can’t do x=y; they exist in different scope. A new scope can be created with curly braces {}, which means loops, if statement  and functions all have their own scope.  The three statements in the previous macro can exist in different scopes like in this example:

// Check the hardware and enabled if off
if(HWREGISTER.ON == false)
setup_some_hardware();

An if() statement without curly braces {} will execute the single next statement if the condition is true.  This causes a problem because the preprocessor expands the macro to:

// Check the hardware and enabled if off
if(HWREGISTER.ON == false)
hw_register1=0x12;hw_register2=0x34;hw_register3=0x56

This results in hw_register2 and hw_register3 ALWAYS being set and only hw_register1 affected by the if() statement.  In C you can’t have semicolons in parentheses, so what do you do to group the statements?  One solution is to add curly braces {} to macros that don’t return a value so all statements are in the same scope.  This seems logical however in C you can’t have a semicolon after a brace which means you have some statements with semicolons and some without, which can lead to some really hard to find bugs.

The solution for this problem is to wrap the multiple statements in do{ }while(0).  If you took  CS101, the do{}while() loop will always allow one execution before evaluating the condition in the while().  Since while(0) is always false any good ANSI C preprocessor will remove the do{}while(0) and only execute the code once.  Since the loop uses curly braces to create a new scope, all statements are in the same scope and a semicolon can be used on the statement.

#define setup_some_hardware()            do{hw_register1=0x12;hw_register2=0x34;hw_register3=0x56;}while(0)

// Check the hardware and enabled if off
if(HWREGISTER.ON == false)
setup_some_hardware();

An additional benefit of the scope created by the do{ }while(0) is that new variables can be created in the new scope.

#define swap_int(val1,val2)              do{int tmp; tmp=val1; val1=val2; val2=tmp;}while(0)

if(some_condition)
swap_int(x,y);

A little known/understood element in C is the L-value. L-values can be though of as the value returned from the right side of a C statement to the left side of the statement. a do{ }while() loop has no L-value and will result in a compiler error if an L-value is expected, so any statement that returns a value should NOT use do{ }while(0) wrapping.  A good rule of thumb is if the statement returns a value use parathenses, if it doesn’t, use do{ }while(0).

The following is an excerpt from a UART C header which uses the preprocessor to give more developer friendly names to sequences of statements and convoluted register names:

#define uart1_interrupt_rx_enable()      do{IEC0bits.U1RXIE = 1;}while(0)
#define uart1_interrupt_rx_disable()     do{IEC0bits.U1RXIE = 0;}while(0)
#define uart1_interrupt_rx_clear()         do{IFS0bits.U1RXIF = 0;}while(0)
#define uart1_interrupt_rx_set()             do{IFS0bits.U1RXIF = 1;}while(0)
#define uart1_interrupt_tx_enable()      do{IEC0bits.U1TXIE = 1;}while(0)
#define uart1_interrupt_tx_disable()     do{IEC0bits.U1TXIE = 0;}while(0)

#define uart1_tx_buffer_full()              (U1STAbits.UTXBF == 1)
#define uart1_tx_last_done()               (U1STAbits.TRMT==1)
#define uart1_rx_overrun_get()           (U1STAbits.OERR)

#define uart1_reset()             do{U1MODE = 0;U1STA = 0;}while(0)
#define uart1_enable()         do{U1MODEbits.UARTEN = 1;}while(0)

 All the preprocessor macros that I have shown will compile down into “in line” instructions.  This speeds up execution compared to functions since the processor doesn’t have to create a stack frame and branch to another location in code just to do a simple bit set.  The one downside is highly used macros with multiple statements will be injected into the source each time they are used, which can lead to larger code.  I try and keep preprocessor macros short and simple to reduce this.

Nixie test

Here is a short video of the nixie tube clock with the first nixie tube connected.  The controller board uses a PIC24FV32KA302 processor, a 74HC595 shift register, a 74LS374 octal latch and 74141 driver chip to control an IN-14 nixie tube.

Check back for more on the clock.

Been there

I have been there…

Robust C Code Part 2 – Advanced C Preprecessor

I my last post ‘Robust C Code Part 1 – C Preprocessor‘ I talked about the C preprocessor and how it can be used to hide registers from the user without adding code space for lots of functions.  In this post I will talk a little more about the preprocessor and some of the more advanced features.

The C preprocessor also takes arguments, just like functions.  Take a look at this example

#define days_in_years(value)        (365*value)

int x,y,x;
x = days_in_years(1);
y = days_in_years(10);
z = days_in_years(65);

This code works similar to the code in the first post, it replaces days_in_years(value) with (365*value), the text ‘value’ is replaced with the argument to result in (365*1), (365*10) and (365*65). The C preprocessor isn’t just a copy and paste tool for strings of text, in addition to direct replacement of text the preprocessor allows concatenation of strings using the ‘##’ directive.  Take the following example:

// Allow PortA, pin 1 to be accessed with led1() macro
#define led1(func)  porta_pin_1_##func

// PIC24 PortA pin 1 register macros
#define porta_pin_1_output()               (TRISAbits.TRISA1 = 0)
#define porta_pin_1_input()                (TRISAbits.TRISA1 = 1)
#define porta_pin_1_high()                 (LATAbits.LATA1 = 1)
#define porta_pin_1_low()                   (LATAbits.LATA1 = 0)

This example uses the same port macros as part 1 of this series.  The new line is how to hide register access and name pins in a more developer friendly way.  Read over the next part a few times, I will take it one step at a time.

First the ‘##’ in the macro is the concatenation directive for the preprocessor, it says we should take the argument ‘func’ and replace ‘##func’ with whatever we passed in.  Lets say we have the following in our C code:

led1(somejunktext);

This would replace ‘##func’ in the macro with ‘somejunktext’ and concatenate the text string ‘porta_pin_1_’ with ‘somejunktext’ to make a new sequence of text:

porta_pin_1_somejunktext;

Now, this result is very similar to the format of the pin macros we have listed above, but instead of ‘somejunktext’ the ‘porta_pin_1_’ is followed by ‘output()’, ‘input()’, ‘high()’ and ‘low()’.  Because the preprocessor does direct text replacement you can have these strings of characters as arguments:

led1(output());
led1(high());

This results in:

porta_pin_1_output();
porta_pin_1_high();

Which turns into:

TRISAbits.TRISA1 = 0;
LATAbits.LATA1 = 1;

The really nice thing about using preprocessor string concatenation  is you can switch all references to a pin very quickly with just changing the directive:

// Allow PortA, pin 1 to be accesses with led1() macro (Not used)
//#define led1(func)  porta_pin_1_##
// Allow PortA, pin 4 to be accesses with led1() macro (Now this is on pin 4 and all the code still works)
#define led1(func)  porta_pin_4_##

Now, to really blow your mind, you can use multiple concatenation operators in a single macro, which can allow for lots of macros without the code space required for a function:

#define porta_pin_high(pinnum)       porta_pin_##pinnum##_high()
#define porta_pin_low(pinnum)         porta_pin_##pinnum##_low()

porta_pin_high(1);
porta_pin_high(2);
porta_pin_low(3);
porta_pin_low(4);
porta_pin_high(5);

Multiple concatenation makes the set function I mentioned in part 1 of the series really easy:

#define pin_output(portname,pinnum)       ##portname##_pin_##pinnum##_output()

pin_output(porta,1);
pin_output(portb,2);
pin_output(portb,7);

Take a look at this example of a header file for the PIC24 microcontroller for an idea of what can be done with this technique.

Nixie boards

So the nixie boards are in.  I used iTeadStudios from China to make a few daughter boards that hold 2 nixies, 2 74141 driver chips and a 74LS374 octal latch.  Using a 374 latch and the 74141 chips allow me to write an 8-bit value to the boards and latch it in.

The boards are 5cm by 5cm and cost <$2 each from iTead since I got 10. Shipping took about a month, so if you plan on using them, plan accordingly.

The daughter boards are attached to a controller board with a PIC24FV32KA302 micro and a 74LS595 shift register.  The controller was made by Advanced Circuits here in colorado and came in today after about ~5 business days. I have to say it is probally my best board ever, guess all this practice is paying off.  I did make a few mistakes, including routing the nixie board connector backwards, which means some hacked connector pins. Good decisions PCBs come from experience, experience come from making bad decisions PCBs.

Controller schematic

Daughter boards (I forgot to add 5V to the connector, so that is a blue wire)

Robust C Code Part 1 – C Preprocessor

For years I tried to write C code for microcontrollers that was robust, modular, and reusable with limited success.  It always seemed that there was some requirement that caused a module to become dedicated to a specific piece of hardware or switching to another processor caused hours of reworking register bits.  Over the last few years I was exposed to some really cool ways to make C code more robust and flexible which allows code reuse and reduces fat-finger errors of setting the wrong bits.  I wanted to create a series of posts on this and one of the first places to start is using the C preprocessor to make accessing hardware more user friendly.

Microcontroller development differs from operating system development in C in many ways, one of which is accessing hardware directly from the C language. Each microcontroller has special hardware that interfaces with the real world, for example a general purpose IO pin is used to interact with the real world using logic signals (high and low). Accessing the port pins differs wildly from processor to processor, to access the PortA pin 1 of a Microchip PIC24 chip in C would look something like this:

// Make PortA pin 1 an output
TRISAbits.TRISA1 = 0;
// Make PortA pin 1 a high value
LATAbits.LATA1 = 1;

This can look a little confusing to some, it would be much easier if there was a function that the developer could call, for example pin_output(porta,1), which would do this for you.  Now you could make a function that does that, however since microcontrollers usually have limited FLASH and RAM, making functions for each register and bit can get out of hand quickly.  The solution is the C preprocessor. The preprocessor uses ‘directives‘ which are like instructions that get run before the compiler. Some directive examples are #define, #include, and #pragma. The #define directive replaces sequences of text in C sources.  If you have ever wrote basic C the following macro will look familiar:

#define DAYS_IN_A_YEAR    365

The C preprocessor searches for the sequence of characters DAYS_IN_A_YEAR in the C source and replaces it with the numbers 365.  No checking is done, so having “#define bit 44” would replace the characters ‘bit’ with 44, which can result in the previous example turning into:

// Make PortA pin 1 an output
TRISA44s.TRISA1 = 0;
// Make PortA pin 1 a high value
LATA44s.LATA1 = 1;

Since there is no TRIS44 register in the PIC24, this won’t compile.  However you can use the direct replacement of the preprocessor to make setting bits very easy to remember and look like functions.  Take the following preprocessor #define directive for example

#define days_in_a_year()    (365)

This replaces days_in_a year() with the characters (365).  This is called a macro. Now you can have some C code that does the following

int x;
x = days_in_a_year();

days_in_a_year() is a macro, not a function, it looks like one, but when the C preprocessor runs you get the following:

int x;
x = (365);

No function code is developed and the code will (most likely) compile to a single instruction or two, to move the value 365 into the variable x. The same ‘function’ trick can be done with the port pin assignment mentioned above.  Take a look at these preprocessor directives

// PIC24 PortA pin 1 register macros
#define porta_pin_1_output()               (TRISAbits.TRISA1 = 0)
#define porta_pin_1_input()                (TRISAbits.TRISA1 = 1)
#define porta_pin_1_high()                 (LATAbits.LATA1 = 1)
#define porta_pin_1_low()                   (LATAbits.LATA1 = 0)

// Make PortA pin 1 an output
porta_pin_1_output();
// Make PortA pin 1 a high value
porta_pin_1_high();

If you put the directives in a header file and include it in your code, you will never have to set a bit register again.  Also, if you move processors, lets say to an Atmel Atmega, you can change the preprocessor directives and all the code is changed automatically:

// Atmel Atmega PortA pin 1 register macros
#define porta_pin_1_output()               (DDRA.1 = 1)
#define porta_pin_1_input()                (DDRA.1 = 0)
#define porta_pin_1_high()                 (PORTA.1 = 1)
#define porta_pin_1_low()                   (PORTA.1 = 0)

// Make PortA pin 1 an output
porta_pin_1_output();
// Make PortA pin 1 a high value
porta_pin_1_high();

That’s it for this post, there is MUCH more you can do with C and the preprocessor, so check back for some more posts in the series.

WordPress Themes