| ??? 03/11/08 13:54 Read: times |
#152118 - Port config Responding to: ???'s previous message |
Chris Bertrand said:
The code below is setting up the port as QUASI BIDIRECTIONAL yet code architect is doing it as OPEN DRAIN i believe. Not sure if that's the issue or not, didn't have time to test it.
The user's manual addresses this in section 3.2.7 (page 33). The code looks ok, like I said I would use continuous auto scan mode so you would just have to enable your other channel in ADINS and change ADMODA to 0x30. I would also just start the conversions once, so remove the ADCON1 from your forever loop and just initialize it to 0x05. Also, I don't know if you really need to wait for the conversion before reading AD1DAT2 into size. If your ADC clock is set anywhere near 3.3MHz I doubt the readings will ever not be new or too old for your needs. If this is the case you could remove the while waiting on ADCON1 bit 3 and the subsequent clearing of the bit. |
| Topic | Author | Date |
| Problems with Code Architect and interrupts | 01/01/70 00:00 | |
| where is the ISR? | 01/01/70 00:00 | |
| Erik... | 01/01/70 00:00 | |
| you enable an interrupt for which there is no ISR | 01/01/70 00:00 | |
| I missed the ISR routine.... | 01/01/70 00:00 | |
| Whoops, here is the .c file with the ADC ISR..... | 01/01/70 00:00 | |
| Also forgot mention...simulation works fine | 01/01/70 00:00 | |
| I found part of my problem | 01/01/70 00:00 | |
| Interrupts | 01/01/70 00:00 | |
| Modified.....seems right, I2C bus going nuts | 01/01/70 00:00 | |
| Polling or Interrupts | 01/01/70 00:00 | |
| Exactly...... | 01/01/70 00:00 | |
| Opinion | 01/01/70 00:00 | |
| Gentlemen....thats what I thought I had!! | 01/01/70 00:00 | |
Port config | 01/01/70 00:00 | |
| poll .... | 01/01/70 00:00 |



