Jump to content

Snowdan

EstablishedMember
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Snowdan

  • Rank
    Newbrie
  1. If RD2 should be pin 3 of port d then your having the same problems i did you dont show your definitions of RD in the code but here is what i did. I have created a header file i include incase i want PICC type pin definitions there in lower case as not to conflict with variables in system.h heres an example of the portd definitions and the header takes advantage of the ifdef to allow the same header to be used with all pics #ifdef PORTD volatile bit rd0 @ PORTD.0; volatile bit rd1 @ PORTD.1; volatile bit rd2 @ PORTD.2; volatile bit rd3 @ PORTD.3; volatile bit rd4 @ PORTD.4; volatile bit rd5 @ PORTD.5; volatile bit rd6 @ PORTD.6; volatile bit rd7 @ PORTD.7; #endif and the TRIS #ifdef TRISD volatile bit trisd0 @ TRISD.0; volatile bit trisd1 @ TRISD.1; volatile bit trisd2 @ TRISD.2; volatile bit trisd3 @ TRISD.3; volatile bit trisd4 @ TRISD.4; volatile bit trisd5 @ TRISD.5; volatile bit trisd6 @ TRISD.6; volatile bit trisd7 @ TRISD.7; #endif Hope this helps Daniel
  2. Can someone just clarafy how to use the plug-ins and if they work with Boost C. I have set up the blocks jsut an LED and a button to the ports i want and have the code that should make LED go on when the buttin is pressed, but not sure how you start it i notice the simulate button is gone as is the wizard when boost C is selected is the wizard going to be implemanted again it was a very usefull feature and is there a guide to making the plugins do somthing i think i must just be missing it. Daniel
  3. Not sure if this is the correct section or if this has been anwered before I cant find it if it has but was just wondering if there are any plans to create a CAN driver like the I2C and RS232, these are such usefull files and having a CAN driver file is now the only thing forcing me to use PICC and not BoostC all the time.
  4. I had the same problem trying to use the i2c driver see post for details, my understanding is that delay_us cant be used at 4MHz, I know you say you dont call it or call any functions that do but thats the only way you would get this error, can you post your code so we can see what exactly is called maybe delay is called from a function u dont relise your calling. Daniel
  5. Im trying to use a 16f88 or 16f628 to access another device via I2C and was looking at the i2c_driver.h file and although it works fine for 18 series at 40 Mhz in both software and hardware mode, I cant get it to firstly run at 4Mhz due to the error cant create delay_us() for clock freq 4000000 delay_10us() must be passed whole number i think i have got round this as dly is 10 i set it to 1 and changed delay_us() to delay_10us() but am not sure and secondly when i change the target to a 16 series it compiles unless u call an i2c routine all I get is I2C-Test.c(103:2): error: failed to generate expression making it difficult to track down what needs to be changed, im guessing its the deffinitions in the i2c routines but in software emulation mode i dont know what to change. Is it possible to use the hardware on a 16f88 as a master the datasheet is not clear on this and secondly is it possible to change the i2c_header to be used on a 16 series with no MI2C. Thanks for your time Daniel P.S why is it that missing semicolon comes up a lot when there isnt one but something else has been done wrong?
  6. Thank you once again Ive been having an understanding block with this but now have my program working and with the new headers every thing is so much easier to code and understand i was trying to set 0x0006 = 0 i see why that would never work thanks and i now have my quaser programmer auto programming from with in sourceboost which i think is the icing on the cake with this program cheers for all your help with such a minor problem. Daniel
  7. I cant handle this anymore im not stupid but i just cxant make even the simplest program work and am going to give up and run back to PICC due to my total lack of understanding . I now have the new header files andwas so pleased i can now write #include "system.h" volatile bit LED @ PORTB.0; void main() { LED = 1; } which is great i no longer have to re-define the registers in the header files just to declare a variable for a pin but after this fantastic news i tried to make TRISB equal zero with void init(void) { TRISB = 0; } void init(void) { TRISB.0 = 0; } void init(void) { TRISB.0 = 0b; } void init(void) { TRISB = 0x00; } void init(void) { TRISB = 11111110b; } all give Flash.c(10:8): internal error: failed to generate assignment expression Failed and i had to define TB0 as a bit in TRISB and set that to zero now just to put me out my misary can some one please tell me how this can be done so that its possible to have variables that point to a single pin and ones that point to ports that can be assigned the value you want Daniel
  8. Please ignore last post the headers didnt extract to the correct place the new ones are exactly what i needed thank you to you and all that help creating these Daniel
  9. Im sorry to keep asking but ive just downloaded the new headers and still dont seem to be able to use the port definitions in it to define indervidual pins #include "system.h" volatile bit rb0 @ portb.0; void main() { rb0 = 1; } i get missing semicolon on the volatile line which means i still ahve to define portb my self does this mean i cant use those defined in the header to define specific pins.
  10. Thanks for the resposne and the code u provided does work which im sure you knew but when i tryed somthing similar yerterday i got missing semicolon never mind i must have been doing something wrong. Daniel
  11. Hi, I hate to ask a stupid question but I have used PICC and CCS where I have had to define registers and where they have been in the header, and am so far liking this compiler not only for cost but also 16 and 18 support but I cant understand why registers have been defined as for example portb 0x0006 and not 0x06 I was looking at the post about pin definition as I have been using bit set until now but for this code to work volatile bit RB0 @ PORTB.0; PORTB must be defined as 0x06 and it cannot be replaced by portb. Now I’m sure there’s a reason and a way around having to redefine PORTB I tried bit shifting but not sure in the correct way could you please explain why all registers are 0x**** and if there’s an easy way to access them as portb.0, Thanks for any help Daniel An idea is a dangerous thing if it’s the only one you have!
×
×
  • Create New...