Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About rfhaley

  • Rank

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
    Edmonton, AB, CANADA
  1. Many most humble thankyous In a past life I used to teach introductory programming at university. Oldtimer's disease must be setting in early; I'm not even 52 yet. It works great with y = rand()%20+1; Mod 20 gives 20 remainders and +1 shifts from 0-19 up to 1-20.
  2. I have 20 leds and I want them to twinkle at random using a 12F629. My subroutine accepts an unsigned char between 1 & 20. The program is fine, no errors and blinks a lot of patterns except my random part. I have included rand...16...lib with no problems rand() returns unsigned short so it is 16 bits? or 0 to 65535? or is it a fraction between 0 & 1 like the rest of my world? I thought I could use unsigned char y = 20*rand() + 1; but it does not work. I also tried unsigned char y = 20*rand()/65535; with all sorts of tries at parenthesis to deal with possible overflows and s
  3. Thanks. I think we're making progress. The EZ uses a bootloader so I thought it might be a loss of bootloader, but now it seems to be the jammed reset. My system sends 24V to one board that feeds the EZ and sends 5V back up the same Cat5 (15m) cable to another PIC. Power on sequence trouble would bother the second PIC but it does not. Power and ground are connected before power on and Never disconnected with the power on. For sure, disconnecting, with the power on, the Cat5 cable that carries power & ground will blow up the PICs. My entire project is a 128bit line follower that ha
  4. Quite right. Microchip shows a list of troubles related to latchup. It turns out I have several EZ with burnt out reset pins. The 18F252 by itself shows a short to ground. I wonder what I have done? One of the bad chips was on a board that did not even connect the reset button. The EZ reset is pulled up by 10k and has a capacitor to ground. Still looking...
  5. I took 4 EZs from existing boards that were socket mounted intermediate prototypes. The first one would not accept a program until I clicked over and over, 6 times. Then it accepted the communication. I am using the cable that came with my devices and changing only the EZ dip (with the power off!). The second programmed right away. The last two will not accept a program no matter how many times I reset or reclick the Program button. The power LED is on for every chip but I am repairing my basement so my shop is in boxes. It does not matter whether I am in Sourceboost or running EZDownloader
  6. Thanks to both. I suspect there is trouble using my grounded design on an ungrounded 50Hz source, but I have no deliberate connections to case ground. My friend says there is powerline noise, at 50V to ground, on the ground side of his supply so maybe everything is toast or I should have used differential signals. His computer ground should be the same as the EZ due to the programming cable. The EZ is fed from a 24/5V switcher on my board and the 24V is isolated and comes from a PLC that is working. Sounds like a badproject...
  7. I programmed some EZ controllers here and sent them to a friend overseas. He tells me they don't work and he wants to re-program them. I watched him download some programs on his computer while he was here and he knows how to do it. He is describing a problem I have often encountered over the last few years of using the EZcontroller. The EZ Downloader stops and prints a message that it 'cannot communicate with device'. Many times this happens because I screwed up the I/O portB.1 & .3 pins so please ignore that as a response (He is just reloading software that I know is functional). He kn
  8. No, Really. I know what I want. I may not have convinced everybody else though. The forum search is fine. I just don't want answers that tell me to RTFM. I want an EZ controller (available from Sourceboost.com) to send USB info to a PC. The EZ already has a MAX232 and I can use it (and I have for two years), software and all. My SmartRelay will trip an interrupt on PortB, and depending on which pin caused the interrupt, send a text message over the USB. How could I use the MAX232 to send USB signals instead of rs232 signals? I have plenty of rs232 code already, I am looking for hi
  9. Since I can't search a 3 letter term like USB on this forum I ask for hints. Can I make a USB connection to the EZcontroller? It is a PIC18F252 & has a max232 onboard but I know little about USB protocols. Has anybody made any code like the rs232 code in boostC?
  10. First, a 16F84 has a different part number than 16F88. This makes me wonder why. Try reading the data sheet on PortB, there is more to I/O than tris. RB3 is not available for I/O Unless you ask for it first. keep smiling and keep reading.
  11. 'Tell me, I forget Show me, I remember Let me do it for myself, I understand' I learned what I needed from the data sheet Read the chapter on Analog Converter, my comments for ADCON are directly from my data sheet. Try to calculate your own conversion delays. I would rather have somebody get me started with an example though.
  12. yeah, i misread that part ... haste makes waste i guess. <{POST_SNAPBACK}> You won't find many more hasteful or wasty than me. Not only do I discard adresl, some of the setpoints are >>3 because I want a fairly small range for some things. This also removes some jitter in the last bit as it requires many more turns of the pot to make the A2D output change. My LCD is only 122 wide so my 'center' needs only 128 choices. My 'gates' either side of center only need a range of 32. Opposite my 5 A2D & I/O board is my line sensor board talking 50 feet away on RS232
  13. I use one pin for each A2D and read 5 analog values on portA with my 18F252. This accuracy is as good as the A2D on your chip so why use a one wire sensor? This is just some clippings so ignore any extra lines. My delay is probably too long but I have plenty of time in my loop. volatile bit A2D_not_done@0x0FC2.2; // bit 2 of adcon0 trisa = 11111111b; // ALL PORT A inputs trisb = 11110111b; // DON'T BUGGER UP PORTB.0 or .3 trisc = 10000000b; // all Port C outputs except RC7 is RX // initialize ADC for user inputs adcon1 = 00000010b; // // bit 7; 0 = left justify // bit 6; adcs2 FOR CLO
  14. Being dimmer than most, I often SaveAs another name and then keep on editing my code. When I notice that the hex file is not changing I realize I am editing the new file but compiling the old file ( which has not changed). The obvious symptom is when I click Compile and it says DONE without doing anything.
  • Create New...