Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About cac001

  • Rank

Profile Information

  • Location
    USA, left coast
  • Interests
  1. Asking for this kind of help means this LCD project is too complex for your level of experience. Use a very simple project to gain understanding of how to use the SourceBoost tools.
  2. I tried what you suggested but I cannot get TIMER0 to count from and external input. The next thing I tried was to use a PIC18F4550 as the target and RA4 as the T0CKI input. I connected a button plugin to RA4 and toggled it on and off but never saw TIMER0 count. Maybe I do not know how to get the simulator to see a change on T0CKI. There does not seem to be much in the way of details on how to use the simulator in the SourceBoost IDE documentation.
  3. That fixed it. Thanks. A follow on question: How do you get the external clock for TIMER0 to work in the simulator for the PIC18F46J50? Charles.
  4. Dave, I looked at the \SourceBoost\config\PIC18F46J50.tdf file and it does have issues. This is at the end of the file TargetConfig FOSC { // Oscillator Selection bits: ConfigRegAddr = 0x0000FFF8; ConfigBitMask = 0b00001111; ConfigSettings = 0b00000000, "LP","LP oscillator", 0b00000001, "XT","XT oscillator", 0b00000010, "HS","HS oscillator", 0b00000011, "RC","External RC oscillator, CLKOUT function on RA6", 0b00000100, "EC","EC oscillator, CLKOUT function on RA6", 0b00000101, "ECIO6","EC oscillator, port function on RA6", 0b00000110, "HSPLL","HS oscillator, PLL enabled (Clock Freq
  5. Here are four methods to toggle bit RA0: while (1) { lata.0 ^= 1; delay_ms(2); } 00E6 label4 00E6 7089 BTG gbl_lata,0 00E8 0E02 MOVLW 0x02 00EA 6E0C MOVWF delay_ms_00000_arg_del 00EC EC0EF000 CALL delay_ms_00000 00F0 D7FA BRA label4 while (1) { lata ^= 0b00000001; delay_ms(2); } 00E6 label4 00E6 0E01 MOVLW 0x01 00E8 1A89 XORWF gbl_lata, F 00EA 0E02 MOVLW 0x02 00EC 6E0C MOVWF delay_ms_00000_arg_del 00EE EC0EF000 CALL delay_ms_00000 00F2 D7F9 BRA label4 while (1) { lata.0 ? lata.0 = 0 : lata.0 = 1; delay_ms(2); } 00E6 label4 00E6 A08
  6. Bug description: The #pragma config for the PIC18F46J50 fails to set the configuration bits correctly. Steps to reproduce: Use this configuration: #pragma config XINST = OFF #pragma config STVREN = OFF #pragma config PLLDIV = 2 #pragma config WDTEN = OFF #pragma config CP0 = OFF #pragma config CPUDIV = OSC2_PLL2 #pragma config IESO = OFF #pragma config FCMEN = OFF #pragma config LPT1OSC = ON #pragma config T1DIG = OFF #pragma config FOSC = INTIO67 #pragma config WDTPS = 32768 #pragma config DSWDTPS = G2 #pragma config DSWDTEN = OFF #pragma config DSBOREN = OFF #pragma con
  7. If we regard the exit code in hex it is: 0xC0000005 I searched google with "windows hresult C0000005" or this link. After looking at a few of them this error may be a result of a failure of some other service in your windows system. You should check the event log to see of there is something odd going on.
  8. I'm sure that tejaswiyvs appreciates your reply. The content of your reply is a tad short on helpfulness. You could have mentioned that the header files for BoostC follow a long accepted convention where #define constants are always UPPER_CASE though the other popular C compilers for the PIC16F targets define the Special Function Registers with upper case. You may have gone farther saying that BoostC is more correct in the wider sense it is more trouble for a beginner to PIC and C programming because example source code from other PIC environments will not compile without changing the
  9. Picixe, danmc77, The PLL in the 18F4550 is a little more finicky. It is designed to multiply a 4MHz input to 96MHz. This is a 24x multiply. For this PLL to work well the input must be very close to 4MHz. Anything faster or slower runs the risk fo the PLL locking on to an alias of 4MHz. When using the PLL you are limited to crystals or oscillators that are 4MHz multiples of the PLL Prescaler selections of divides by 1, 2 , 3, 4, 5, 6, 10, and 12. This means frequencies of 4, 8, 12, 16, 20, 24, 40 and 48 MHz. If your crystal is not one of these then the PLL may not work. If you a
  10. Definitely not a bug: ;Address Opcode Disassembly ; 052 1623 BSF 0x23, 0x4 ; 053 14A4 BSF 0x24, 0x1
  11. Not portable code - if you are worried about that sort of thing. I would go for something like: char x = 0; do { ... ... } while( --x != 0 ); Regards Dave This is just a little more portable: char x = 0; do { ... ... } while((++x & 0xFF) != 0 ); Most compilers implement char as 8-bits. I am working with an embedded platform that has no 8-bit addressable registers or memory. Your example is not portable to this implementation.
  12. It may not be possible to alter configuration words from the bootloader context. Are you sure that your PIC is able to change configuration words while a program is running?
  13. I would like to help but there are some choices that only you can make. Depending on what you choose the fuse setting will become obvious. The PIC18F2550 has support to expose a USB endpoint. If you are developing a USB device you cannot use the internal oscillator as a clock source for the USB function block. You must use an external crystal or oscillator. If you are not using the USB and do not want an external crystal then the internal oscillator is your only clock choice. The maximum frequency available with the internal oscillator is 8MHz. So now you need to decide wh
  14. You may want to look at this site too: http://www.electronic-engineering.ch/micro...s/projects.html
  15. A reset should not be required, but a lot of USB hosts will power down when the last device disconnects. This is not too common on desktops but is typical for laptops. If your device is not self powered then when the host powers down the port your PIC will loose power too.
  • Create New...